@jpp-toolkit/eslint-config 0.0.11
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/LICENSE.md +21 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.mjs +654 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +73 -0
- package/src/configs/eslint-config.ts +1305 -0
- package/src/configs/ignore-config.ts +17 -0
- package/src/configs/import-x-config.ts +344 -0
- package/src/configs/jsx-a11y-config.ts +278 -0
- package/src/configs/perfectionist-config.ts +180 -0
- package/src/configs/prettier-config.ts +11 -0
- package/src/configs/react-config.ts +706 -0
- package/src/configs/react-hooks-config.ts +11 -0
- package/src/configs/stylistic-config.ts +746 -0
- package/src/configs/typescript-config.ts +1211 -0
- package/src/configs/unicorn-config.ts +1212 -0
- package/src/configs/vitest-config.ts +536 -0
- package/src/index.ts +73 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { includeIgnoreFile } from '@eslint/compat';
|
|
2
|
+
import { findGitIgnore } from '@jpp-toolkit/utils';
|
|
3
|
+
import { defineConfig } from 'eslint/config';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Generates an ESLint configuration that ignores files based on the project's .gitignore.
|
|
7
|
+
* @see {@link https://eslint.org/docs/latest/use/configure/ignore#including-gitignore-files}
|
|
8
|
+
*/
|
|
9
|
+
export const ignoreConfig = (rootDir?: string) => {
|
|
10
|
+
const gitIgnorePath = findGitIgnore(rootDir);
|
|
11
|
+
const config = includeIgnoreFile(gitIgnorePath);
|
|
12
|
+
|
|
13
|
+
return defineConfig({
|
|
14
|
+
name: 'ignore-config',
|
|
15
|
+
extends: [config],
|
|
16
|
+
});
|
|
17
|
+
};
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
2
|
+
import { createNodeResolver, importX } from 'eslint-plugin-import-x';
|
|
3
|
+
import { defineConfig } from 'eslint/config';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Import X configuration.
|
|
7
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x}
|
|
8
|
+
*/
|
|
9
|
+
export const importXConfig = defineConfig([
|
|
10
|
+
{
|
|
11
|
+
name: 'import-x-config',
|
|
12
|
+
// @ts-expect-error - import-x flatConfigs is wrongly typed
|
|
13
|
+
extends: [importX.flatConfigs.recommended],
|
|
14
|
+
settings: {
|
|
15
|
+
'import-x/resolver-next': [createNodeResolver()],
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
/**
|
|
19
|
+
* Forbid imported names marked with @deprecated documentation tag.
|
|
20
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-deprecated.md}
|
|
21
|
+
*/
|
|
22
|
+
// 'import-x/no-deprecated': 'error',
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Forbid empty named import blocks.
|
|
26
|
+
* @fixable
|
|
27
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-empty-named-blocks.md}
|
|
28
|
+
*/
|
|
29
|
+
'import-x/no-empty-named-blocks': 'error',
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Forbid the use of extraneous packages.
|
|
33
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-extraneous-dependencies.md}
|
|
34
|
+
*/
|
|
35
|
+
// 'import-x/no-extraneous-dependencies': 'error',
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Forbid the use of mutable exports with var or let.
|
|
39
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-mutable-exports.md}
|
|
40
|
+
*/
|
|
41
|
+
'import-x/no-mutable-exports': 'error',
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Forbid importing a default export by a different name.
|
|
45
|
+
* @config warnings
|
|
46
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-rename-default.md}
|
|
47
|
+
*/
|
|
48
|
+
'import-x/no-rename-default': 'off',
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Forbid modules without exports, or exports without matching import in another module.
|
|
52
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unused-modules.md}
|
|
53
|
+
*/
|
|
54
|
+
'import-x/no-unused-modules': 'error',
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Forbid AMD require and define calls.
|
|
58
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-amd.md}
|
|
59
|
+
*/
|
|
60
|
+
// 'import-x/no-amd': 'error',
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Forbid CommonJS require calls and module.exports or exports.*.
|
|
64
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-commonjs.md}
|
|
65
|
+
*/
|
|
66
|
+
// 'import-x/no-commonjs': 'error',
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Forbid import statements with CommonJS module.exports.
|
|
70
|
+
* @fixable
|
|
71
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-import-module-exports.md}
|
|
72
|
+
*/
|
|
73
|
+
// 'import-x/no-import-module-exports': 'error',
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Forbid Node.js builtin modules.
|
|
77
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-nodejs-modules.md}
|
|
78
|
+
*/
|
|
79
|
+
// 'import-x/no-nodejs-modules': 'error',
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Forbid potentially ambiguous parse goal (script vs. module).
|
|
83
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/unambiguous.md}
|
|
84
|
+
*/
|
|
85
|
+
// 'import-x/unambiguous': 'error',
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Forbid import of modules using absolute paths.
|
|
89
|
+
* @fixable
|
|
90
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-absolute-path.md}
|
|
91
|
+
*/
|
|
92
|
+
'import-x/no-absolute-path': 'error',
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Forbid a module from importing a module with a dependency path back to itself.
|
|
96
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-cycle.md}
|
|
97
|
+
*/
|
|
98
|
+
'import-x/no-cycle': 'error',
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Forbid require() calls with expressions.
|
|
102
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-dynamic-require.md}
|
|
103
|
+
*/
|
|
104
|
+
// 'import-x/no-dynamic-require': 'error',
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Forbid importing the submodules of other modules.
|
|
108
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-internal-modules.md}
|
|
109
|
+
*/
|
|
110
|
+
// 'import-x/no-internal-modules': 'error',
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Forbid importing packages through relative paths.
|
|
114
|
+
* @fixable
|
|
115
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-relative-packages.md}
|
|
116
|
+
*/
|
|
117
|
+
'import-x/no-relative-packages': 'error',
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Forbid importing modules from parent directories.
|
|
121
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-relative-parent-imports.md}
|
|
122
|
+
*/
|
|
123
|
+
// 'import-x/no-relative-parent-imports': 'error',
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Enforce which files can be imported in a given folder.
|
|
127
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-restricted-paths.md}
|
|
128
|
+
*/
|
|
129
|
+
// 'import-x/no-restricted-paths': 'error',
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Forbid a module from importing itself.
|
|
133
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-self-import.md}
|
|
134
|
+
*/
|
|
135
|
+
'import-x/no-self-import': 'error',
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Forbid unnecessary path segments in import and require statements.
|
|
139
|
+
* @fixable
|
|
140
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-useless-path-segments.md}
|
|
141
|
+
*/
|
|
142
|
+
'import-x/no-useless-path-segments': 'error',
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Forbid webpack loader syntax in imports.
|
|
146
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-webpack-loader-syntax.md}
|
|
147
|
+
*/
|
|
148
|
+
// 'import-x/no-webpack-loader-syntax': 'error',
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Enforce or ban the use of inline type-only markers for named imports.
|
|
152
|
+
* @fixable
|
|
153
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/consistent-type-specifier-style.md}
|
|
154
|
+
*/
|
|
155
|
+
'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Enforce a leading comment with the webpackChunkName for dynamic imports.
|
|
159
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/dynamic-import-chunkname.md}
|
|
160
|
+
*/
|
|
161
|
+
// 'import-x/dynamic-import-chunkname': 'error',
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Ensure all exports appear after other statements.
|
|
165
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/exports-last.md}
|
|
166
|
+
*/
|
|
167
|
+
// 'import-x/exports-last': 'error',
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Ensure consistent use of file extension within the import path.
|
|
171
|
+
* @fixable
|
|
172
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/extensions.md}
|
|
173
|
+
*/
|
|
174
|
+
// 'import-x/extensions': 'error',
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Ensure all imports appear before other statements.
|
|
178
|
+
* @fixable
|
|
179
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/first.md}
|
|
180
|
+
*/
|
|
181
|
+
'import-x/first': 'error',
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Prefer named exports to be grouped together in a single export declaration.
|
|
185
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/group-exports.md}
|
|
186
|
+
*/
|
|
187
|
+
// 'import-x/group-exports': 'error',
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Replaced by import-x/first.
|
|
191
|
+
* @fixable
|
|
192
|
+
* @deprecated
|
|
193
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/imports-first.md}
|
|
194
|
+
*/
|
|
195
|
+
// 'import-x/imports-first': 'error',
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Enforce the maximum number of dependencies a module can have.
|
|
199
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/max-dependencies.md}
|
|
200
|
+
*/
|
|
201
|
+
// 'import-x/max-dependencies': 'error',
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Enforce a newline after import statements.
|
|
205
|
+
* @fixable
|
|
206
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/newline-after-import.md}
|
|
207
|
+
*/
|
|
208
|
+
'import-x/newline-after-import': 'error',
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Forbid anonymous values as default exports.
|
|
212
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-anonymous-default-export.md}
|
|
213
|
+
*/
|
|
214
|
+
// 'import-x/no-anonymous-default-export': 'error',
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Forbid default exports.
|
|
218
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-default-export.md}
|
|
219
|
+
*/
|
|
220
|
+
// 'import-x/no-default-export': 'error',
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Forbid named default exports.
|
|
224
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-default.md}
|
|
225
|
+
*/
|
|
226
|
+
// 'import-x/no-named-default': 'error',
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Forbid named exports.
|
|
230
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-export.md}
|
|
231
|
+
*/
|
|
232
|
+
// 'import-x/no-named-export': 'error',
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Forbid namespace (a.k.a. "wildcard" *) imports.
|
|
236
|
+
* @fixable
|
|
237
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-namespace.md}
|
|
238
|
+
*/
|
|
239
|
+
// 'import-x/no-namespace': 'error',
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Forbid unassigned imports.
|
|
243
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unassigned-import.md}
|
|
244
|
+
*/
|
|
245
|
+
// 'import-x/no-unassigned-import': 'error',
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Enforce a convention in module import order.
|
|
249
|
+
* @fixable
|
|
250
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/order.md}
|
|
251
|
+
*/
|
|
252
|
+
// 'import-x/order': 'error',
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Prefer a default export if module exports a single name or multiple names.
|
|
256
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-default-export.md}
|
|
257
|
+
*/
|
|
258
|
+
// 'import-x/prefer-default-export': 'error',
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Enforce using namespace imports for specific modules, like react/react-dom, etc.
|
|
262
|
+
* @fixable
|
|
263
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-namespace-import.md}
|
|
264
|
+
*/
|
|
265
|
+
// 'import-x/prefer-namespace-import': 'error',
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Forbid any invalid exports, i.e. re-export of the same name.
|
|
269
|
+
* @config recommended
|
|
270
|
+
* @config errors
|
|
271
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/export.md}
|
|
272
|
+
*/
|
|
273
|
+
// 'import-x/export': 'off',
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Forbid use of exported name as identifier of default export.
|
|
277
|
+
* @config recommended
|
|
278
|
+
* @config warnings
|
|
279
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default.md}
|
|
280
|
+
*/
|
|
281
|
+
'import-x/no-named-as-default': 'off',
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Forbid use of exported name as property of default export.
|
|
285
|
+
* @config recommended
|
|
286
|
+
* @config warnings
|
|
287
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default-member.md}
|
|
288
|
+
*/
|
|
289
|
+
'import-x/no-named-as-default-member': 'off',
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Ensure a default export is present, given a default import.
|
|
293
|
+
* @config recommended
|
|
294
|
+
* @config errors
|
|
295
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/default.md}
|
|
296
|
+
*/
|
|
297
|
+
// 'import-x/default': 'off',
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Ensure named imports correspond to a named export in the remote file.
|
|
301
|
+
* @config recommended
|
|
302
|
+
* @config typescript
|
|
303
|
+
* @config errors
|
|
304
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/named.md}
|
|
305
|
+
*/
|
|
306
|
+
// 'import-x/named': 'off',
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Ensure imported namespaces contain dereferenced properties as they are dereferenced.
|
|
310
|
+
* @config recommended
|
|
311
|
+
* @config errors
|
|
312
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/namespace.md}
|
|
313
|
+
*/
|
|
314
|
+
// 'import-x/namespace': 'off',
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Ensure imports point to a file/module that can be resolved.
|
|
318
|
+
* @config recommended
|
|
319
|
+
* @config errors
|
|
320
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unresolved.md}
|
|
321
|
+
*/
|
|
322
|
+
'import-x/no-unresolved': 'off',
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Forbid repeated import of the same module in multiple places.
|
|
326
|
+
* @config recommended
|
|
327
|
+
* @config warnings
|
|
328
|
+
* @fixable
|
|
329
|
+
* @see {@link https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-duplicates.md}
|
|
330
|
+
*/
|
|
331
|
+
'no-duplicate-imports': 'off',
|
|
332
|
+
// 'import-x/no-duplicates': 'off',
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: 'import-x-config-typescript',
|
|
337
|
+
files: ['**/*.{ts,tsx}'],
|
|
338
|
+
// @ts-expect-error - import-x flatConfigs is wrongly typed
|
|
339
|
+
extends: [importX.flatConfigs.typescript],
|
|
340
|
+
settings: {
|
|
341
|
+
'import-x/resolver-next': [createTypeScriptImportResolver(), createNodeResolver()],
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
]);
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
2
|
+
import { defineConfig } from 'eslint/config';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* JSX a11y configuration.
|
|
6
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y}
|
|
7
|
+
*/
|
|
8
|
+
export const jsxA11yConfig = defineConfig({
|
|
9
|
+
name: 'jsx-a11y-config',
|
|
10
|
+
extends: [jsxA11y.flatConfigs.recommended],
|
|
11
|
+
rules: {
|
|
12
|
+
/**
|
|
13
|
+
* Enforce emojis are wrapped in <span> and provide screen reader access.
|
|
14
|
+
* @deprecated
|
|
15
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/accessible-emoji.md}
|
|
16
|
+
*/
|
|
17
|
+
// 'jsx-a11y/accessible-emoji': 'error',
|
|
18
|
+
/**
|
|
19
|
+
* Enforce lang attribute has a valid value.
|
|
20
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/lang.md}
|
|
21
|
+
*/
|
|
22
|
+
// 'jsx-a11y/lang': 'error',
|
|
23
|
+
/**
|
|
24
|
+
* Disallow aria-hidden="true" from being set on focusable elements.
|
|
25
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-aria-hidden-on-focusable.md}
|
|
26
|
+
*/
|
|
27
|
+
// 'jsx-a11y/no-aria-hidden-on-focusable': 'error',
|
|
28
|
+
/**
|
|
29
|
+
* Enforce usage of onBlur over onChange on select menus for accessibility.
|
|
30
|
+
* @deprecated
|
|
31
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-onchange.md}
|
|
32
|
+
*/
|
|
33
|
+
// 'jsx-a11y/no-onchange': 'error',
|
|
34
|
+
/**
|
|
35
|
+
* Enforces using semantic DOM elements over the ARIA role property.
|
|
36
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/prefer-tag-over-role.md}
|
|
37
|
+
*/
|
|
38
|
+
// 'jsx-a11y/prefer-tag-over-role': 'error',
|
|
39
|
+
/**
|
|
40
|
+
* Enforce all elements that require alternative text have meaningful information to relay back to end user.
|
|
41
|
+
* @config recommended
|
|
42
|
+
* @config strict
|
|
43
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/alt-text.md}
|
|
44
|
+
*/
|
|
45
|
+
// 'jsx-a11y/alt-text': 'off',
|
|
46
|
+
/**
|
|
47
|
+
* Enforce <a> text to not exactly match "click here", "here", "link", or "a link".
|
|
48
|
+
* @config recommended
|
|
49
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-ambiguous-text.md}
|
|
50
|
+
*/
|
|
51
|
+
// 'jsx-a11y/anchor-ambiguous-text': 'off',
|
|
52
|
+
/**
|
|
53
|
+
* Enforce all anchors to contain accessible content.
|
|
54
|
+
* @config recommended
|
|
55
|
+
* @config strict
|
|
56
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-has-content.md}
|
|
57
|
+
*/
|
|
58
|
+
// 'jsx-a11y/anchor-has-content': 'off',
|
|
59
|
+
/**
|
|
60
|
+
* Enforce all anchors are valid, navigable elements.
|
|
61
|
+
* @config recommended
|
|
62
|
+
* @config strict
|
|
63
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-is-valid.md}
|
|
64
|
+
*/
|
|
65
|
+
// 'jsx-a11y/anchor-is-valid': 'off',
|
|
66
|
+
/**
|
|
67
|
+
* Enforce elements with aria-activedescendant are tabbable.
|
|
68
|
+
* @config recommended
|
|
69
|
+
* @config strict
|
|
70
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-activedescendant-has-tabindex.md}
|
|
71
|
+
*/
|
|
72
|
+
// 'jsx-a11y/aria-activedescendant-has-tabindex': 'off',
|
|
73
|
+
/**
|
|
74
|
+
* Enforce all aria-* props are valid.
|
|
75
|
+
* @config recommended
|
|
76
|
+
* @config strict
|
|
77
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-props.md}
|
|
78
|
+
*/
|
|
79
|
+
// 'jsx-a11y/aria-props': 'off',
|
|
80
|
+
/**
|
|
81
|
+
* Enforce ARIA state and property values are valid.
|
|
82
|
+
* @config recommended
|
|
83
|
+
* @config strict
|
|
84
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-proptypes.md}
|
|
85
|
+
*/
|
|
86
|
+
// 'jsx-a11y/aria-proptypes': 'off',
|
|
87
|
+
/**
|
|
88
|
+
* Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
|
|
89
|
+
* @config recommended
|
|
90
|
+
* @config strict
|
|
91
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-role.md}
|
|
92
|
+
*/
|
|
93
|
+
// 'jsx-a11y/aria-role': 'off',
|
|
94
|
+
/**
|
|
95
|
+
* Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes.
|
|
96
|
+
* @config recommended
|
|
97
|
+
* @config strict
|
|
98
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-unsupported-elements.md}
|
|
99
|
+
*/
|
|
100
|
+
// 'jsx-a11y/aria-unsupported-elements': 'off',
|
|
101
|
+
/**
|
|
102
|
+
* Enforce that autocomplete attributes are used correctly.
|
|
103
|
+
* @config recommended
|
|
104
|
+
* @config strict
|
|
105
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/autocomplete-valid.md}
|
|
106
|
+
*/
|
|
107
|
+
// 'jsx-a11y/autocomplete-valid': 'off',
|
|
108
|
+
/**
|
|
109
|
+
* Enforce a clickable non-interactive element has at least one keyboard event listener.
|
|
110
|
+
* @config recommended
|
|
111
|
+
* @config strict
|
|
112
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/click-events-have-key-events.md}
|
|
113
|
+
*/
|
|
114
|
+
// 'jsx-a11y/click-events-have-key-events': 'off',
|
|
115
|
+
/**
|
|
116
|
+
* Enforce that a control (an interactive element) has a text label.
|
|
117
|
+
* @config recommended
|
|
118
|
+
* @config strict
|
|
119
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/control-has-associated-label.md}
|
|
120
|
+
*/
|
|
121
|
+
// 'jsx-a11y/control-has-associated-label': 'off',
|
|
122
|
+
/**
|
|
123
|
+
* Enforce heading (h1, h2, etc) elements contain accessible content.
|
|
124
|
+
* @config recommended
|
|
125
|
+
* @config strict
|
|
126
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/heading-has-content.md}
|
|
127
|
+
*/
|
|
128
|
+
// 'jsx-a11y/heading-has-content': 'off',
|
|
129
|
+
/**
|
|
130
|
+
* Enforce <html> element has lang prop.
|
|
131
|
+
* @config recommended
|
|
132
|
+
* @config strict
|
|
133
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/html-has-lang.md}
|
|
134
|
+
*/
|
|
135
|
+
// 'jsx-a11y/html-has-lang': 'off',
|
|
136
|
+
/**
|
|
137
|
+
* Enforce iframe elements have a title attribute.
|
|
138
|
+
* @config recommended
|
|
139
|
+
* @config strict
|
|
140
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/iframe-has-title.md}
|
|
141
|
+
*/
|
|
142
|
+
// 'jsx-a11y/iframe-has-title': 'off',
|
|
143
|
+
/**
|
|
144
|
+
* Enforce <img> alt prop does not contain the word "image", "picture", or "photo".
|
|
145
|
+
* @config recommended
|
|
146
|
+
* @config strict
|
|
147
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/img-redundant-alt.md}
|
|
148
|
+
*/
|
|
149
|
+
// 'jsx-a11y/img-redundant-alt': 'off',
|
|
150
|
+
/**
|
|
151
|
+
* Enforce that elements with interactive handlers like onClick must be focusable.
|
|
152
|
+
* @config recommended
|
|
153
|
+
* @config strict
|
|
154
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/interactive-supports-focus.md}
|
|
155
|
+
*/
|
|
156
|
+
// 'jsx-a11y/interactive-supports-focus': 'off',
|
|
157
|
+
/**
|
|
158
|
+
* Enforce that a label tag has a text label and an associated control.
|
|
159
|
+
* @config recommended
|
|
160
|
+
* @config strict
|
|
161
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-associated-control.md}
|
|
162
|
+
*/
|
|
163
|
+
// 'jsx-a11y/label-has-associated-control': 'off',
|
|
164
|
+
/**
|
|
165
|
+
* Enforce that <label> elements have the htmlFor prop.
|
|
166
|
+
* @config recommended
|
|
167
|
+
* @config strict
|
|
168
|
+
* @deprecated
|
|
169
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-for.md}
|
|
170
|
+
*/
|
|
171
|
+
// 'jsx-a11y/label-has-for': 'off',
|
|
172
|
+
/**
|
|
173
|
+
* Enforces that <audio> and <video> elements must have a <track> for captions.
|
|
174
|
+
* @config recommended
|
|
175
|
+
* @config strict
|
|
176
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/media-has-caption.md}
|
|
177
|
+
*/
|
|
178
|
+
// 'jsx-a11y/media-has-caption': 'off',
|
|
179
|
+
/**
|
|
180
|
+
* Enforce that onMouseOver/onMouseOut are accompanied by onFocus/onBlur for keyboard-only users.
|
|
181
|
+
* @config recommended
|
|
182
|
+
* @config strict
|
|
183
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/mouse-events-have-key-events.md}
|
|
184
|
+
*/
|
|
185
|
+
// 'jsx-a11y/mouse-events-have-key-events': 'off',
|
|
186
|
+
/**
|
|
187
|
+
* Enforce that the accessKey prop is not used on any element to avoid complications with keyboard commands used by a screen reader.
|
|
188
|
+
* @config recommended
|
|
189
|
+
* @config strict
|
|
190
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-access-key.md}
|
|
191
|
+
*/
|
|
192
|
+
// 'jsx-a11y/no-access-key': 'off',
|
|
193
|
+
/**
|
|
194
|
+
* Enforce autoFocus prop is not enabled.
|
|
195
|
+
* @config recommended
|
|
196
|
+
* @config strict
|
|
197
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-autofocus.md}
|
|
198
|
+
*/
|
|
199
|
+
// 'jsx-a11y/no-autofocus': 'off',
|
|
200
|
+
/**
|
|
201
|
+
* Enforce distracting elements are not used.
|
|
202
|
+
* @config recommended
|
|
203
|
+
* @config strict
|
|
204
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-distracting-elements.md}
|
|
205
|
+
*/
|
|
206
|
+
// 'jsx-a11y/no-distracting-elements': 'off',
|
|
207
|
+
/**
|
|
208
|
+
* Interactive elements should not be assigned non-interactive roles.
|
|
209
|
+
* @config recommended
|
|
210
|
+
* @config strict
|
|
211
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-interactive-element-to-noninteractive-role.md}
|
|
212
|
+
*/
|
|
213
|
+
// 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'off',
|
|
214
|
+
/**
|
|
215
|
+
* Non-interactive elements should not be assigned mouse or keyboard event listeners.
|
|
216
|
+
* @config recommended
|
|
217
|
+
* @config strict
|
|
218
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-interactions.md}
|
|
219
|
+
*/
|
|
220
|
+
// 'jsx-a11y/no-noninteractive-element-interactions': 'off',
|
|
221
|
+
/**
|
|
222
|
+
* Non-interactive elements should not be assigned interactive roles.
|
|
223
|
+
* @config recommended
|
|
224
|
+
* @config strict
|
|
225
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-to-interactive-role.md}
|
|
226
|
+
*/
|
|
227
|
+
// 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'off',
|
|
228
|
+
/**
|
|
229
|
+
* TabIndex should only be declared on interactive elements.
|
|
230
|
+
* @config recommended
|
|
231
|
+
* @config strict
|
|
232
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-tabindex.md}
|
|
233
|
+
*/
|
|
234
|
+
// 'jsx-a11y/no-noninteractive-tabindex': 'off',
|
|
235
|
+
/**
|
|
236
|
+
* Enforce explicit role property is not the same as implicit/default role property on element.
|
|
237
|
+
* @config recommended
|
|
238
|
+
* @config strict
|
|
239
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-redundant-roles.md}
|
|
240
|
+
*/
|
|
241
|
+
// 'jsx-a11y/no-redundant-roles': 'off',
|
|
242
|
+
/**
|
|
243
|
+
* Enforce that non-interactive, visible elements (such as <div>) that have click handlers use the role attribute.
|
|
244
|
+
* @config recommended
|
|
245
|
+
* @config strict
|
|
246
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-static-element-interactions.md}
|
|
247
|
+
*/
|
|
248
|
+
// 'jsx-a11y/no-static-element-interactions': 'off',
|
|
249
|
+
/**
|
|
250
|
+
* Enforce that elements with ARIA roles must have all required attributes for that role.
|
|
251
|
+
* @config recommended
|
|
252
|
+
* @config strict
|
|
253
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-has-required-aria-props.md}
|
|
254
|
+
*/
|
|
255
|
+
// 'jsx-a11y/role-has-required-aria-props': 'off',
|
|
256
|
+
/**
|
|
257
|
+
* Enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role.
|
|
258
|
+
* @config recommended
|
|
259
|
+
* @config strict
|
|
260
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-supports-aria-props.md}
|
|
261
|
+
*/
|
|
262
|
+
// 'jsx-a11y/role-supports-aria-props': 'off',
|
|
263
|
+
/**
|
|
264
|
+
* Enforce scope prop is only used on <th> elements.
|
|
265
|
+
* @config recommended
|
|
266
|
+
* @config strict
|
|
267
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/scope.md}
|
|
268
|
+
*/
|
|
269
|
+
// 'jsx-a11y/scope': 'off',
|
|
270
|
+
/**
|
|
271
|
+
* Enforce tabIndex value is not greater than zero.
|
|
272
|
+
* @config recommended
|
|
273
|
+
* @config strict
|
|
274
|
+
* @see {@link https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/tabindex-no-positive.md}
|
|
275
|
+
*/
|
|
276
|
+
// 'jsx-a11y/tabindex-no-positive': 'off',
|
|
277
|
+
},
|
|
278
|
+
});
|