-
Notifications
You must be signed in to change notification settings - Fork 17
/
eslint.config.js
95 lines (94 loc) · 2.91 KB
/
eslint.config.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
const pkg = require('./package.json');
/**
* 0: off
* 1: warn
* 2: error
*/
module.exports = {
overrides: [
{
files: ['**/__tests__/**/*', '**/*.{spec,test}.*'],
rules: {
'jest/consistent-test-it': [1, { fn: 'test' }],
'jest/expect-expect': 1,
'jest/no-deprecated-functions': 2
}
}
],
settings: {
'import/core-modules': [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})]
},
rules: {
'react/react-in-jsx-scope': 2,
'react/no-unsafe': [2, { checkAliases: true }],
'react/no-deprecated': 2,
'import/no-anonymous-default-export': [
2,
{
allowArray: true,
allowArrowFunction: false,
allowAnonymousClass: false,
allowAnonymousFunction: false,
allowCallExpression: true, // The true value here is for backward compatibility
allowLiteral: true,
allowObject: true
}
],
'import/no-duplicates': 1,
'import/order': [
1,
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'object', 'unknown']
}
],
'import/no-useless-path-segments': [
1,
{
noUselessIndex: true
}
],
'lines-between-class-members': [1, 'always', { exceptAfterSingleLine: true }],
'padding-line-between-statements': [
1,
{
blankLine: 'always',
prev: [
'multiline-block-like',
'multiline-expression',
'const',
'let',
'var',
'cjs-import',
'import',
'export',
'cjs-export',
'class',
'throw',
'directive'
],
next: '*'
},
{
blankLine: 'always',
prev: '*',
next: [
'multiline-block-like',
'multiline-expression',
'const',
'let',
'var',
'cjs-import',
'import',
'export',
'cjs-export',
'class',
'throw',
'return'
]
},
{ blankLine: 'any', prev: ['cjs-import', 'import'], next: ['cjs-import', 'import'] },
{ blankLine: 'any', prev: ['export', 'cjs-export'], next: ['export', 'cjs-export'] },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] }
]
}
};