-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
112 lines (112 loc) · 3.12 KB
/
.eslintrc.js
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
module.exports = {
settings: {
react: {
version: 'detect',
},
},
root: true,
plugins: ['prettier', 'testing-library', 'eslint-comments', 'import'],
globals: {
Maybe: true,
Falsy: true,
JSX: true,
GDRequest: true,
__DEV__: true,
_trfq: true,
HivemindExperiment: true,
FeatureFlags: true,
},
extends: [
'plugin:jest/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:react/jsx-runtime',
],
parser: '@typescript-eslint/parser',
rules: {
'react/self-closing-comp': 'error',
'prettier/prettier': 'error',
eqeqeq: ['error', 'always', { null: 'ignore' }],
'react-hooks/exhaustive-deps': 'off',
'id-length': 'off',
'jest/valid-expect-in-promise': 'error',
'cypress/no-unnecessary-waiting': 'off',
complexity: ['error', { max: 40 }],
'max-statements': ['error', { max: 50 }],
'no-undefined': 'off',
'no-var': 'error',
'no-duplicate-imports': ['error', { includeExports: true }],
curly: 'error',
'require-await': 'error',
'eslint-comments/no-unlimited-disable': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true },
],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{ 'ts-ignore': 'allow-with-description' },
],
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'react/jsx-pascal-case': ['error', { allowNamespace: true }],
'react/jsx-curly-brace-presence': [
'error',
{ props: 'never', children: 'never' },
],
'import/no-unresolved': 'off',
'import/order': [
'warn',
{
groups: [['builtin', 'external'], ['parent', 'sibling'], 'index'],
'newlines-between': 'always',
},
],
'import/newline-after-import': 'error',
'default-param-last': 'error',
},
ignorePatterns: ['coverage', 'reports'],
overrides: [
{
files: ['**/?(*.)+(cy).[jt]s?(x)'],
rules: {
'jest/valid-expect-in-promise': 'off',
'jest/expect-expect': 'off',
'jest/valid-expect': 'off',
},
},
{
files: ['**/?(*.)+(spec).[jt]s?(x)'],
extends: ['plugin:testing-library/react'],
rules: {
'testing-library/await-async-queries': 'error',
'testing-library/no-await-sync-queries': 'error',
'testing-library/no-debugging-utils': 'warn',
'testing-library/no-dom-import': 'off',
'testing-library/no-node-access': [
'error',
{ allowContainerFirstChild: true },
],
'jest/no-conditional-in-test': 'error',
'jest/prefer-to-be': 'error',
},
},
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.ts?(x)'],
parserOptions: {
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
},
},
],
};