-
Notifications
You must be signed in to change notification settings - Fork 66
/
eslint.config.mjs
130 lines (108 loc) · 2.92 KB
/
eslint.config.mjs
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import globals from 'globals'
export default [{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
impliedStrict: true,
jsx: true,
},
},
},
rules: {
'array-bracket-spacing': ['warn', 'never'],
'arrow-body-style': ['warn', 'as-needed'],
'arrow-parens': ['warn', 'as-needed'],
'arrow-spacing': 'warn',
'block-scoped-var': 'error',
'brace-style': ['warn', '1tbs'],
'class-methods-use-this': 'warn',
'comma-spacing': ['warn', {
before: false,
after: true,
}],
'computed-property-spacing': ['warn', 'never'],
'constructor-super': 'error',
curly: ['warn', 'multi'],
'dot-notation': 'warn',
'getter-return': 'error',
indent: ['warn', 2, {
SwitchCase: 1,
}],
'key-spacing': ['warn', {
afterColon: true,
}],
'keyword-spacing': 'warn',
'no-class-assign': ['error'],
'no-cond-assign': 'error',
'no-const-assign': 'error',
'no-dupe-args': 'error',
'no-dupe-class-members': 'error',
'no-dupe-keys': 'error',
'no-duplicate-imports': 'error',
'no-else-return': 'error',
'no-global-assign': 'error',
'no-invalid-this': 'error',
'no-multi-spaces': ['warn', {
ignoreEOLComments: true,
}],
'no-multiple-empty-lines': ['warn', {
max: 1,
maxEOF: 1,
}],
'no-param-reassign': 'warn',
'no-redeclare': 'error',
'no-return-assign': ['warn', 'always'],
'no-shadow-restricted-names': 'error',
'no-this-before-super': 'error',
'no-trailing-spaces': 'warn',
'no-undef': 'error',
'no-unexpected-multiline': 'error',
'no-unneeded-ternary': 'warn',
'no-unreachable': 'error',
'no-unused-private-class-members': 'warn',
'no-unused-vars': ['warn', {
args: 'after-used',
}],
'no-use-before-define': ['error', {
functions: false,
}],
'no-useless-constructor': 'error',
'no-useless-rename': 'error',
'no-var': 'error',
'object-curly-spacing': ['warn', 'always'],
'object-shorthand': 'warn',
'operator-assignment': ['warn', 'always'],
'prefer-arrow-callback': 'warn',
'prefer-const': ['warn', {
ignoreReadBeforeAssign: true,
}],
'prefer-destructuring': ['warn', {
object: true,
array: false,
}],
'prefer-spread': 'error',
quotes: ['warn', 'single'],
semi: ['warn', 'never', {
beforeStatementContinuationChars: 'always',
}],
'semi-spacing': ['warn', {
before: false,
after: true,
}],
'space-before-blocks': 'warn',
'space-before-function-paren': ['warn', 'never'],
'space-in-parens': ['warn', 'never'],
'space-infix-ops': 'warn',
'spaced-comment': ['warn', 'always'],
'vars-on-top': 'error',
yoda: ['error', 'never', {
exceptRange: true,
}],
},
}]