@innovixx/eslint-config 3.0.13 → 4.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +370 -20
- package/config/configs/base/index.mjs +40 -40
- package/config/configs/base/rules/best-practices.mjs +331 -333
- package/config/configs/base/rules/errors.mjs +115 -115
- package/config/configs/base/rules/es6.mjs +176 -176
- package/config/configs/base/rules/imports.mjs +238 -238
- package/config/configs/base/rules/variables.mjs +31 -31
- package/config/configs/jest/index.mjs +19 -19
- package/config/configs/jest/rules/jest-dom.mjs +8 -8
- package/config/configs/jest/rules/jest.mjs +33 -33
- package/config/configs/react/index.mjs +31 -42
- package/config/configs/react/rules/custom-rules.mjs +332 -0
- package/config/configs/react/rules/react-a11y.mjs +227 -227
- package/config/configs/react/rules/react-hooks.mjs +6 -6
- package/config/configs/react/rules/react.mjs +49 -452
- package/config/configs/typescript/index.mjs +24 -24
- package/config/configs/typescript/rules/all.mjs +14 -14
- package/config/configs/typescript/settings/typescript.mjs +8 -11
- package/config/deepMerge.mjs +47 -47
- package/config/index.mjs +117 -117
- package/demo/components/ComponentTest/index.tsx +1 -1
- package/demo/components/ComponentTestWithProps/index.tsx +2 -2
- package/package.json +19 -20
- package/tsconfig.json +1 -1
|
@@ -1,245 +1,245 @@
|
|
|
1
|
-
import globals from
|
|
2
|
-
import importPlugin from
|
|
1
|
+
import globals from 'globals';
|
|
2
|
+
import importPlugin from 'eslint-plugin-import';
|
|
3
3
|
|
|
4
4
|
/** @type {import('eslint').Linter.Config} */
|
|
5
5
|
|
|
6
6
|
const importRules = {
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
7
|
+
languageOptions: {
|
|
8
|
+
globals: {
|
|
9
|
+
globals: {
|
|
10
|
+
...globals.es2015,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
parserOptions: {
|
|
15
|
+
ecmaVersion: 'latest',
|
|
16
|
+
sourceType: 'module',
|
|
17
|
+
},
|
|
18
|
+
plugins: {
|
|
19
|
+
import: importPlugin,
|
|
20
|
+
},
|
|
21
|
+
settings: {
|
|
22
|
+
'import/resolver': {
|
|
23
|
+
node: {
|
|
24
|
+
extensions: [
|
|
25
|
+
'.ts',
|
|
26
|
+
'.tsx',
|
|
27
|
+
'.jsx',
|
|
28
|
+
'.js',
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
rules: {
|
|
34
|
+
// Static analysis:
|
|
35
|
+
|
|
36
|
+
// ensure imports point to files/modules that can be resolved
|
|
37
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
|
|
38
|
+
'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
|
|
39
|
+
|
|
40
|
+
// ensure named imports coupled with named exports
|
|
41
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
|
|
42
|
+
'import/named': 'error',
|
|
43
|
+
|
|
44
|
+
// ensure default import coupled with default export
|
|
45
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
|
|
46
|
+
'import/default': 'off',
|
|
47
|
+
|
|
48
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/namespace.md
|
|
49
|
+
'import/namespace': 'off',
|
|
50
|
+
|
|
51
|
+
// Helpful warnings:
|
|
52
|
+
|
|
53
|
+
// disallow invalid exports, e.g. multiple defaults
|
|
54
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/export.md
|
|
55
|
+
'import/export': 'error',
|
|
56
|
+
|
|
57
|
+
// do not allow a default import name to match a named export
|
|
58
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
|
|
59
|
+
'import/no-named-as-default': 'error',
|
|
60
|
+
|
|
61
|
+
// warn on accessing default export property names that are also named exports
|
|
62
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
|
|
63
|
+
'import/no-named-as-default-member': 'error',
|
|
64
|
+
|
|
65
|
+
// disallow use of jsdoc-marked-deprecated imports
|
|
66
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
|
|
67
|
+
'import/no-deprecated': 'off',
|
|
68
|
+
|
|
69
|
+
// Forbid the use of extraneous packages
|
|
70
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
71
|
+
// paths are treated both as absolute paths, and relative to process.cwd()
|
|
72
|
+
'import/no-extraneous-dependencies': ['error'],
|
|
73
|
+
|
|
74
|
+
// Forbid mutable exports
|
|
75
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
|
|
76
|
+
'import/no-mutable-exports': 'error',
|
|
77
|
+
|
|
78
|
+
// Module systems:
|
|
79
|
+
|
|
80
|
+
// disallow require()
|
|
81
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
|
|
82
|
+
'import/no-commonjs': 'off',
|
|
83
|
+
|
|
84
|
+
// disallow AMD require/define
|
|
85
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-amd.md
|
|
86
|
+
'import/no-amd': 'error',
|
|
87
|
+
|
|
88
|
+
// No Node.js builtin modules
|
|
89
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
|
|
90
|
+
// TODO: enable?
|
|
91
|
+
'import/no-nodejs-modules': 'off',
|
|
92
|
+
|
|
93
|
+
// Style guide:
|
|
94
|
+
|
|
95
|
+
// disallow non-import statements appearing before import statements
|
|
96
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md
|
|
97
|
+
'import/first': 'error',
|
|
98
|
+
|
|
99
|
+
// disallow non-import statements appearing before import statements
|
|
100
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md
|
|
101
|
+
// deprecated: use `import/first`
|
|
102
|
+
'import/imports-first': 'off',
|
|
103
|
+
|
|
104
|
+
// disallow duplicate imports
|
|
105
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
106
|
+
'import/no-duplicates': 'error',
|
|
107
|
+
|
|
108
|
+
// disallow namespace imports
|
|
109
|
+
// TODO: enable?
|
|
110
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
|
|
111
|
+
'import/no-namespace': 'off',
|
|
112
|
+
|
|
113
|
+
// Ensure consistent use of file extension within the import path
|
|
114
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
|
|
115
|
+
'import/extensions': [
|
|
116
|
+
'error',
|
|
117
|
+
'ignorePackages',
|
|
118
|
+
{
|
|
119
|
+
js: 'never',
|
|
120
|
+
jsx: 'never',
|
|
121
|
+
ts: 'never',
|
|
122
|
+
tsx: 'never',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
|
|
126
|
+
// ensure absolute imports are above relative imports and that unassigned imports are ignored
|
|
127
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
|
|
128
|
+
// TODO: enforce a stricter convention in module import order?
|
|
129
|
+
'import/order': ['error', { groups: [['builtin', 'external', 'internal']] }],
|
|
130
|
+
|
|
131
|
+
// Require a newline after the last import/require in a group
|
|
132
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
|
133
|
+
'import/newline-after-import': 'error',
|
|
134
|
+
|
|
135
|
+
// Require modules with a single export to use a default export
|
|
136
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
|
137
|
+
'import/prefer-default-export': 'off',
|
|
138
|
+
|
|
139
|
+
// Restrict which files can be imported in a given folder
|
|
140
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
|
|
141
|
+
'import/no-restricted-paths': 'off',
|
|
142
|
+
|
|
143
|
+
// Forbid modules to have too many dependencies
|
|
144
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
|
|
145
|
+
'import/max-dependencies': ['off', { max: 10 }],
|
|
146
|
+
|
|
147
|
+
// Forbid import of modules using absolute paths
|
|
148
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
|
|
149
|
+
'import/no-absolute-path': 'error',
|
|
150
|
+
|
|
151
|
+
// Forbid require() calls with expressions
|
|
152
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
|
|
153
|
+
'import/no-dynamic-require': 'error',
|
|
154
|
+
|
|
155
|
+
// prevent importing the submodules of other modules
|
|
156
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md
|
|
157
|
+
'import/no-internal-modules': ['off', {
|
|
158
|
+
allow: [],
|
|
159
|
+
}],
|
|
160
|
+
|
|
161
|
+
// Warn if a module could be mistakenly parsed as a script by a consumer
|
|
162
|
+
// leveraging Unambiguous JavaScript Grammar
|
|
163
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/unambiguous.md
|
|
164
|
+
// this should not be enabled until this proposal has at least been *presented* to TC39.
|
|
165
|
+
// At the moment, it's not a thing.
|
|
166
|
+
'import/unambiguous': 'off',
|
|
167
|
+
|
|
168
|
+
// Forbid Webpack loader syntax in imports
|
|
169
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
170
|
+
'import/no-webpack-loader-syntax': 'error',
|
|
171
|
+
|
|
172
|
+
// Prevent unassigned imports
|
|
173
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md
|
|
174
|
+
// importing for side effects is perfectly acceptable, if you need side effects.
|
|
175
|
+
'import/no-unassigned-import': 'off',
|
|
176
|
+
|
|
177
|
+
// Prevent importing the default as if it were named
|
|
178
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
|
|
179
|
+
'import/no-named-default': 'error',
|
|
180
|
+
|
|
181
|
+
// Reports if a module's default export is unnamed
|
|
182
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md
|
|
183
|
+
'import/no-anonymous-default-export': ['off', {
|
|
184
|
+
allowArray: false,
|
|
185
|
+
allowArrowFunction: false,
|
|
186
|
+
allowAnonymousClass: false,
|
|
187
|
+
allowAnonymousFunction: false,
|
|
188
|
+
allowLiteral: false,
|
|
189
|
+
allowObject: false,
|
|
190
|
+
}],
|
|
191
|
+
|
|
192
|
+
// This rule enforces that all exports are declared at the bottom of the file.
|
|
193
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md
|
|
194
|
+
// TODO: enable?
|
|
195
|
+
'import/exports-last': 'off',
|
|
196
|
+
|
|
197
|
+
// Reports when named exports are not grouped together in a single export declaration
|
|
198
|
+
// or when multiple assignments to CommonJS module.exports or exports object are present
|
|
199
|
+
// in a single file.
|
|
200
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md
|
|
201
|
+
'import/group-exports': 'off',
|
|
202
|
+
|
|
203
|
+
// forbid default exports. this is a terrible rule, do not use it.
|
|
204
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
|
|
205
|
+
'import/no-default-export': 'off',
|
|
206
|
+
|
|
207
|
+
// Prohibit named exports. this is a terrible rule, do not use it.
|
|
208
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md
|
|
209
|
+
'import/no-named-export': 'off',
|
|
210
|
+
|
|
211
|
+
// Forbid a module from importing itself
|
|
212
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
|
|
213
|
+
'import/no-self-import': 'error',
|
|
214
|
+
|
|
215
|
+
// Forbid cyclical dependencies between modules
|
|
216
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
|
|
217
|
+
'import/no-cycle': ['error', { maxDepth: Infinity }],
|
|
218
|
+
|
|
219
|
+
// Ensures that there are no useless path segments
|
|
220
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
|
|
221
|
+
'import/no-useless-path-segments': ['error', { commonjs: true }],
|
|
222
|
+
|
|
223
|
+
// dynamic imports require a leading comment with a webpackChunkName
|
|
224
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/dynamic-import-chunkname.md
|
|
225
|
+
'import/dynamic-import-chunkname': ['off', {
|
|
226
|
+
importFunctions: [],
|
|
227
|
+
webpackChunknameFormat: '[0-9a-zA-Z-_/.]+',
|
|
228
|
+
}],
|
|
229
|
+
|
|
230
|
+
// Use this rule to prevent imports to folders in relative parent paths.
|
|
231
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md
|
|
232
|
+
'import/no-relative-parent-imports': 'off',
|
|
233
|
+
|
|
234
|
+
// Reports modules without any exports, or with unused exports
|
|
235
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md
|
|
236
|
+
// TODO: enable, semver-major
|
|
237
|
+
'import/no-unused-modules': ['off', {
|
|
238
|
+
ignoreExports: [],
|
|
239
|
+
missingExports: true,
|
|
240
|
+
unusedExports: true,
|
|
241
|
+
}],
|
|
242
|
+
},
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
export default importRules;
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
const variableRules = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
rules: {
|
|
3
|
+
// enforce or disallow variable initializations at definition
|
|
4
|
+
'init-declarations': 'off',
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// disallow the catch clause parameter name being the same as a variable in the outer scope
|
|
7
|
+
'no-catch-shadow': 'off',
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// disallow deletion of variables
|
|
10
|
+
'no-delete-var': 'error',
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
// disallow labels that share a name with a variable
|
|
13
|
+
// https://eslint.org/docs/rules/no-label-var
|
|
14
|
+
'no-label-var': 'error',
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// disallow specific globals
|
|
17
|
+
'no-restricted-globals': ['error', 'isFinite', 'isNaN'],
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
// disallow declaration of variables already declared in the outer scope
|
|
20
|
+
'no-shadow': 'error',
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// disallow shadowing of names such as arguments
|
|
23
|
+
'no-shadow-restricted-names': 'error',
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
// disallow use of undeclared variables unless mentioned in a /*global */ block
|
|
26
|
+
'no-undef': 'error',
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
// disallow use of undefined when initializing variables
|
|
29
|
+
'no-undef-init': 'error',
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
// disallow use of undefined variable
|
|
32
|
+
// https://eslint.org/docs/rules/no-undefined
|
|
33
|
+
// TODO: enable?
|
|
34
|
+
'no-undefined': 'off',
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
// disallow declaration of variables that are not used in the code
|
|
37
|
+
// disabled here and enabled in typescript-eslint as it reports errors here
|
|
38
|
+
// https://typescript-eslint.io/rules/no-unused-vars/
|
|
39
|
+
'no-unused-vars': 'off',
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
// disallow use of variables before they are defined
|
|
42
|
+
'no-use-before-define': ['error', { functions: true, classes: true, variables: true }],
|
|
43
|
+
},
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
export default variableRules;
|
|
@@ -9,25 +9,25 @@ import { deepMerge } from '../../deepMerge.mjs';
|
|
|
9
9
|
/** @type {import ('eslint').Linter.Config} */
|
|
10
10
|
|
|
11
11
|
export const index = deepMerge(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
{
|
|
13
|
+
languageOptions: {
|
|
14
|
+
globals: {
|
|
15
|
+
...globals.jest,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
rules: jestRules.rules,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
rules: jestDomRules.rules,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
plugins: {
|
|
27
|
+
jest: jestPlugin,
|
|
28
|
+
'jest-dom': jestDomPlugin,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
31
|
);
|
|
32
32
|
|
|
33
33
|
export default index;
|