-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
76 lines (76 loc) · 2 KB
/
.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* SPDX-FileCopyrightText: 2023 Zextras <https://www.zextras.com>
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
module.exports = {
root: true,
env: { browser: true, es2020: true },
parserOptions: {
project: 'tsconfig.json'
},
extends: ['./node_modules/@zextras/carbonio-ui-configs/rules/eslint.js'],
ignorePatterns: ['dist', '.eslintrc.cjs', 'notice.template.*'],
plugins: ['react-refresh', 'notice'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react/react-in-jsx-scope': 'off',
'sonarjs/no-duplicate-string': 'off',
'notice/notice': [
'error',
{
templateFile: './notice.template.js'
}
],
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error'
},
overrides: [
{
files: [
'**/types/**/*.ts?(x)',
'**/test/**/*.ts?(x)',
'**/mocks/**/*.ts?(x)',
],
rules: {
'import/no-extraneous-dependencies': 'off',
}
},
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
rules: {
'react/jsx-props-no-spreading': 'off'
}
},
{
files: ['vite.config.ts', 'commitlint.config.ts', 'codegen.ts', '.eslintrc.cjs'],
parserOptions: {
project: 'tsconfig.node.json'
},
rules: {
'import/no-extraneous-dependencies': 'off',
}
},
{
files: ['*.graphql'],
parser: '@graphql-eslint/eslint-plugin',
plugins: ['@graphql-eslint'],
rules: {
'prettier/prettier': 'error',
'@graphql-eslint/known-type-names': 'error',
'notice/notice': 'off',
'@typescript-eslint/consistent-type-exports': 'off',
'@typescript-eslint/consistent-type-imports': 'off'
},
parserOptions: {
graphQLConfig: {
operations: './src/graphql/**/*.graphql',
schema: './src/graphql/schema-public.graphql'
}
}
}
]
}