zeno-config 0.1.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 +271 -0
- package/package.json +89 -0
- package/src/eslint/index.d.ts +124 -0
- package/src/eslint/index.js +373 -0
- package/src/eslint/rules/baseRules.js +753 -0
- package/src/eslint/rules/importPluginRules.js +200 -0
- package/src/eslint/rules/jsxA11yPluginRules.js +195 -0
- package/src/eslint/rules/nodePluginRules.js +128 -0
- package/src/eslint/rules/reactHooksPluginRules.js +27 -0
- package/src/eslint/rules/reactPluginRules.js +476 -0
- package/src/eslint/rules/reactYouMightNotNeedAnEffectPluginRules.js +21 -0
- package/src/eslint/rules/stylisticPluginRules.js +330 -0
- package/src/eslint/rules/typescriptPluginRules.js +533 -0
- package/src/eslint/rules/unicornPluginRules.js +441 -0
- package/src/extensions.d.ts +51 -0
- package/src/extensions.js +49 -0
- package/src/prettier.d.ts +4 -0
- package/src/prettier.js +16 -0
- package/src/tsconfig.base.json +31 -0
- package/src/tsconfig.react.json +13 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { allExtensionsString, nodeExtensionsString } from '../../extensions.js';
|
|
2
|
+
|
|
3
|
+
const extensionsDefault = {};
|
|
4
|
+
|
|
5
|
+
const getImportPluginRules = (options = {}) => {
|
|
6
|
+
return {
|
|
7
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/export.md
|
|
8
|
+
'import-x/export': 'error',
|
|
9
|
+
|
|
10
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-deprecated.md
|
|
11
|
+
'import-x/no-deprecated': 'off',
|
|
12
|
+
|
|
13
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-empty-named-blocks.md
|
|
14
|
+
'import-x/no-empty-named-blocks': 'error',
|
|
15
|
+
|
|
16
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
17
|
+
'import-x/no-extraneous-dependencies': [
|
|
18
|
+
'error',
|
|
19
|
+
{
|
|
20
|
+
devDependencies: [
|
|
21
|
+
`**/eslint.config{${nodeExtensionsString}}`, // eslint config
|
|
22
|
+
`**/webpack.*{${nodeExtensionsString}}`, // webpack config
|
|
23
|
+
`**/*.test{${allExtensionsString}}`, // test files
|
|
24
|
+
`**/*.stories{${allExtensionsString}}`, // story files
|
|
25
|
+
`**/.prettierrc{${nodeExtensionsString}}`, // prettier config
|
|
26
|
+
],
|
|
27
|
+
optionalDependencies: false,
|
|
28
|
+
peerDependencies: true,
|
|
29
|
+
bundledDependencies: false,
|
|
30
|
+
includeInternal: false,
|
|
31
|
+
includeTypes: false,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
|
|
35
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-mutable-exports.md
|
|
36
|
+
'import-x/no-mutable-exports': 'error',
|
|
37
|
+
|
|
38
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default.md
|
|
39
|
+
'import-x/no-named-as-default': 'off',
|
|
40
|
+
|
|
41
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default-member.md
|
|
42
|
+
'import-x/no-named-as-default-member': 'off',
|
|
43
|
+
|
|
44
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unused-modules.md
|
|
45
|
+
'import-x/no-unused-modules': [
|
|
46
|
+
'warn',
|
|
47
|
+
{
|
|
48
|
+
missingExports: false,
|
|
49
|
+
unusedExports: true,
|
|
50
|
+
ignoreUnusedTypeExports: false,
|
|
51
|
+
ignoreExports: [
|
|
52
|
+
`**/eslint.config{${nodeExtensionsString}}`,
|
|
53
|
+
...(options.ignoreExports || []),
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
|
|
58
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-amd.md
|
|
59
|
+
'import-x/no-amd': 'error',
|
|
60
|
+
|
|
61
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-commonjs.md
|
|
62
|
+
'import-x/no-commonjs': 'off',
|
|
63
|
+
|
|
64
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-import-module-exports.md
|
|
65
|
+
'import-x/no-import-module-exports': 'error',
|
|
66
|
+
|
|
67
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-nodejs-modules.md
|
|
68
|
+
'import-x/no-nodejs-modules': 'off',
|
|
69
|
+
|
|
70
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/unambiguous.md
|
|
71
|
+
'import-x/unambiguous': 'off',
|
|
72
|
+
|
|
73
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/default.md
|
|
74
|
+
'import-x/default': 'error',
|
|
75
|
+
|
|
76
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
77
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/named.md
|
|
78
|
+
'import-x/named': 'error',
|
|
79
|
+
|
|
80
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/namespace.md
|
|
81
|
+
'import-x/namespace': ['error', { allowComputed: true }],
|
|
82
|
+
|
|
83
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-absolute-path.md
|
|
84
|
+
'import-x/no-absolute-path': 'error',
|
|
85
|
+
|
|
86
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-cycle.md
|
|
87
|
+
'import-x/no-cycle': 'error',
|
|
88
|
+
|
|
89
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-dynamic-require.md
|
|
90
|
+
'import-x/no-dynamic-require': 'error',
|
|
91
|
+
|
|
92
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-internal-modules.md
|
|
93
|
+
'import-x/no-internal-modules': 'off',
|
|
94
|
+
|
|
95
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-relative-packages.md
|
|
96
|
+
'import-x/no-relative-packages': 'error',
|
|
97
|
+
|
|
98
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-relative-parent-imports.md
|
|
99
|
+
'import-x/no-relative-parent-imports': 'off',
|
|
100
|
+
|
|
101
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-restricted-paths.md
|
|
102
|
+
'import-x/no-restricted-paths': 'off',
|
|
103
|
+
|
|
104
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-self-import.md
|
|
105
|
+
'import-x/no-self-import': 'error',
|
|
106
|
+
|
|
107
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unresolved.md
|
|
108
|
+
'import-x/no-unresolved': [
|
|
109
|
+
'error',
|
|
110
|
+
{
|
|
111
|
+
commonjs: true,
|
|
112
|
+
caseSensitive: true,
|
|
113
|
+
caseSensitiveStrict: true,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
|
|
117
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-useless-path-segments.md
|
|
118
|
+
'import-x/no-useless-path-segments': ['error', { commonjs: true }],
|
|
119
|
+
|
|
120
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
121
|
+
'import-x/no-webpack-loader-syntax': 'error',
|
|
122
|
+
|
|
123
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/consistent-type-specifier-style.md
|
|
124
|
+
'import-x/consistent-type-specifier-style': ['error', 'prefer-inline'],
|
|
125
|
+
|
|
126
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/dynamic-import-chunkname.md
|
|
127
|
+
'import-x/dynamic-import-chunkname': 'off',
|
|
128
|
+
|
|
129
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/exports-last.md
|
|
130
|
+
'import-x/exports-last': 'error',
|
|
131
|
+
|
|
132
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/extensions.md
|
|
133
|
+
'import-x/extensions': [
|
|
134
|
+
'error',
|
|
135
|
+
'ignorePackages',
|
|
136
|
+
{ ...extensionsDefault, ...options.extensionsIgnorePattern },
|
|
137
|
+
],
|
|
138
|
+
|
|
139
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/first.md
|
|
140
|
+
'import-x/first': 'error',
|
|
141
|
+
|
|
142
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/group-exports.md
|
|
143
|
+
'import-x/group-exports': 'error',
|
|
144
|
+
|
|
145
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/max-dependencies.md
|
|
146
|
+
'import-x/max-dependencies': 'off',
|
|
147
|
+
|
|
148
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/newline-after-import.md
|
|
149
|
+
'import-x/newline-after-import': ['warn', { considerComments: true }],
|
|
150
|
+
|
|
151
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-anonymous-default-export.md
|
|
152
|
+
'import-x/no-anonymous-default-export': 'off',
|
|
153
|
+
|
|
154
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-default-export.md
|
|
155
|
+
'import-x/no-default-export': 'off',
|
|
156
|
+
|
|
157
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-duplicates.md
|
|
158
|
+
'import-x/no-duplicates': ['error', { 'prefer-inline': true }],
|
|
159
|
+
|
|
160
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-default.md
|
|
161
|
+
'import-x/no-named-default': 'error',
|
|
162
|
+
|
|
163
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-export.md
|
|
164
|
+
'import-x/no-named-export': 'off',
|
|
165
|
+
|
|
166
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-namespace.md
|
|
167
|
+
'import-x/no-namespace': 'off',
|
|
168
|
+
|
|
169
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unassigned-import.md
|
|
170
|
+
'import-x/no-unassigned-import': 'off',
|
|
171
|
+
|
|
172
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/order.md
|
|
173
|
+
'import-x/order': [
|
|
174
|
+
'warn',
|
|
175
|
+
{
|
|
176
|
+
groups: [
|
|
177
|
+
[
|
|
178
|
+
'builtin',
|
|
179
|
+
'external',
|
|
180
|
+
'internal',
|
|
181
|
+
'parent',
|
|
182
|
+
'sibling',
|
|
183
|
+
'index',
|
|
184
|
+
'object',
|
|
185
|
+
'type',
|
|
186
|
+
],
|
|
187
|
+
],
|
|
188
|
+
'newlines-between': 'ignore',
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
|
|
192
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-default-export.md
|
|
193
|
+
'import-x/prefer-default-export': 'warn',
|
|
194
|
+
|
|
195
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-namespace-import.md
|
|
196
|
+
'import-x/prefer-namespace-import': 'off',
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export default getImportPluginRules;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
const getJsxA11yPluginRules = () => {
|
|
2
|
+
return {
|
|
3
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/alt-text.md
|
|
4
|
+
'jsx-a11y/alt-text': 'error',
|
|
5
|
+
|
|
6
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-ambiguous-text.md
|
|
7
|
+
'jsx-a11y/anchor-ambiguous-text': 'off',
|
|
8
|
+
|
|
9
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-has-content.md
|
|
10
|
+
'jsx-a11y/anchor-has-content': 'error',
|
|
11
|
+
|
|
12
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-is-valid.md
|
|
13
|
+
'jsx-a11y/anchor-is-valid': 'error',
|
|
14
|
+
|
|
15
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-activedescendant-has-tabindex.md
|
|
16
|
+
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
|
17
|
+
|
|
18
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-props.md
|
|
19
|
+
'jsx-a11y/aria-props': 'error',
|
|
20
|
+
|
|
21
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-proptypes.md
|
|
22
|
+
'jsx-a11y/aria-proptypes': 'error',
|
|
23
|
+
|
|
24
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-role.md
|
|
25
|
+
'jsx-a11y/aria-role': 'error',
|
|
26
|
+
|
|
27
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-unsupported-elements.md
|
|
28
|
+
'jsx-a11y/aria-unsupported-elements': 'error',
|
|
29
|
+
|
|
30
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/autocomplete-valid.md
|
|
31
|
+
'jsx-a11y/autocomplete-valid': 'error',
|
|
32
|
+
|
|
33
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/click-events-have-key-events.md
|
|
34
|
+
'jsx-a11y/click-events-have-key-events': 'error',
|
|
35
|
+
|
|
36
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/control-has-associated-label.md
|
|
37
|
+
'jsx-a11y/control-has-associated-label': 'off',
|
|
38
|
+
|
|
39
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/heading-has-content.md
|
|
40
|
+
'jsx-a11y/heading-has-content': 'error',
|
|
41
|
+
|
|
42
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/html-has-lang.md
|
|
43
|
+
'jsx-a11y/html-has-lang': 'error',
|
|
44
|
+
|
|
45
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/iframe-has-title.md
|
|
46
|
+
'jsx-a11y/iframe-has-title': 'error',
|
|
47
|
+
|
|
48
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/img-redundant-alt.md
|
|
49
|
+
'jsx-a11y/img-redundant-alt': 'error',
|
|
50
|
+
|
|
51
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/interactive-supports-focus.md
|
|
52
|
+
'jsx-a11y/interactive-supports-focus': 'error',
|
|
53
|
+
|
|
54
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-associated-control.md
|
|
55
|
+
'jsx-a11y/label-has-associated-control': 'error',
|
|
56
|
+
|
|
57
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-for.md
|
|
58
|
+
'jsx-a11y/label-has-for': 'off',
|
|
59
|
+
|
|
60
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/lang.md
|
|
61
|
+
'jsx-a11y/lang': 'off',
|
|
62
|
+
|
|
63
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/media-has-caption.md
|
|
64
|
+
'jsx-a11y/media-has-caption': 'error',
|
|
65
|
+
|
|
66
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/mouse-events-have-key-events.md
|
|
67
|
+
'jsx-a11y/mouse-events-have-key-events': 'error',
|
|
68
|
+
|
|
69
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-access-key.md
|
|
70
|
+
'jsx-a11y/no-access-key': 'error',
|
|
71
|
+
|
|
72
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-aria-hidden-on-focusable.md
|
|
73
|
+
'jsx-a11y/no-aria-hidden-on-focusable': 'off',
|
|
74
|
+
|
|
75
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-autofocus.md
|
|
76
|
+
'jsx-a11y/no-autofocus': 'error',
|
|
77
|
+
|
|
78
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-distracting-elements.md
|
|
79
|
+
'jsx-a11y/no-distracting-elements': 'error',
|
|
80
|
+
|
|
81
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-interactive-element-to-noninteractive-role.md
|
|
82
|
+
'jsx-a11y/no-interactive-element-to-noninteractive-role': [
|
|
83
|
+
'error',
|
|
84
|
+
{
|
|
85
|
+
tr: ['none', 'presentation'],
|
|
86
|
+
canvas: ['img'],
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
|
|
90
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-interactions.md
|
|
91
|
+
'jsx-a11y/no-noninteractive-element-interactions': [
|
|
92
|
+
'error',
|
|
93
|
+
{
|
|
94
|
+
handlers: [
|
|
95
|
+
'onClick',
|
|
96
|
+
'onError',
|
|
97
|
+
'onLoad',
|
|
98
|
+
'onMouseDown',
|
|
99
|
+
'onMouseUp',
|
|
100
|
+
'onKeyPress',
|
|
101
|
+
'onKeyDown',
|
|
102
|
+
'onKeyUp',
|
|
103
|
+
],
|
|
104
|
+
alert: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
|
|
105
|
+
body: ['onError', 'onLoad'],
|
|
106
|
+
dialog: ['onKeyUp', 'onKeyDown', 'onKeyPress'],
|
|
107
|
+
iframe: ['onError', 'onLoad'],
|
|
108
|
+
img: ['onError', 'onLoad'],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
|
|
112
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-to-interactive-role.md
|
|
113
|
+
'jsx-a11y/no-noninteractive-element-to-interactive-role': [
|
|
114
|
+
'error',
|
|
115
|
+
{
|
|
116
|
+
ul: [
|
|
117
|
+
'listbox',
|
|
118
|
+
'menu',
|
|
119
|
+
'menubar',
|
|
120
|
+
'radiogroup',
|
|
121
|
+
'tablist',
|
|
122
|
+
'tree',
|
|
123
|
+
'treegrid',
|
|
124
|
+
],
|
|
125
|
+
ol: [
|
|
126
|
+
'listbox',
|
|
127
|
+
'menu',
|
|
128
|
+
'menubar',
|
|
129
|
+
'radiogroup',
|
|
130
|
+
'tablist',
|
|
131
|
+
'tree',
|
|
132
|
+
'treegrid',
|
|
133
|
+
],
|
|
134
|
+
li: [
|
|
135
|
+
'menuitem',
|
|
136
|
+
'menuitemradio',
|
|
137
|
+
'menuitemcheckbox',
|
|
138
|
+
'option',
|
|
139
|
+
'row',
|
|
140
|
+
'tab',
|
|
141
|
+
'treeitem',
|
|
142
|
+
],
|
|
143
|
+
table: ['grid'],
|
|
144
|
+
td: ['gridcell'],
|
|
145
|
+
fieldset: ['radiogroup', 'presentation'],
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
|
|
149
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-tabindex.md
|
|
150
|
+
'jsx-a11y/no-noninteractive-tabindex': [
|
|
151
|
+
'error',
|
|
152
|
+
{
|
|
153
|
+
tags: [],
|
|
154
|
+
roles: ['tabpanel'],
|
|
155
|
+
allowExpressionValues: true,
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
|
|
159
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-redundant-roles.md
|
|
160
|
+
'jsx-a11y/no-redundant-roles': 'error',
|
|
161
|
+
|
|
162
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-static-element-interactions.md
|
|
163
|
+
'jsx-a11y/no-static-element-interactions': [
|
|
164
|
+
'error',
|
|
165
|
+
{
|
|
166
|
+
allowExpressionValues: true,
|
|
167
|
+
handlers: [
|
|
168
|
+
'onClick',
|
|
169
|
+
'onMouseDown',
|
|
170
|
+
'onMouseUp',
|
|
171
|
+
'onKeyPress',
|
|
172
|
+
'onKeyDown',
|
|
173
|
+
'onKeyUp',
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
|
|
178
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/prefer-tag-over-role.md
|
|
179
|
+
'jsx-a11y/prefer-tag-over-role': 'off',
|
|
180
|
+
|
|
181
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-has-required-aria-props.md
|
|
182
|
+
'jsx-a11y/role-has-required-aria-props': 'error',
|
|
183
|
+
|
|
184
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-supports-aria-props.md
|
|
185
|
+
'jsx-a11y/role-supports-aria-props': 'error',
|
|
186
|
+
|
|
187
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/scope.md
|
|
188
|
+
'jsx-a11y/scope': 'error',
|
|
189
|
+
|
|
190
|
+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/tabindex-no-positive.md
|
|
191
|
+
'jsx-a11y/tabindex-no-positive': 'error',
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export default getJsxA11yPluginRules;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
const getNodePluginRules = () => {
|
|
2
|
+
return {
|
|
3
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md
|
|
4
|
+
'n/callback-return': 'off',
|
|
5
|
+
|
|
6
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/exports-style.md
|
|
7
|
+
'n/exports-style': [
|
|
8
|
+
'error',
|
|
9
|
+
'module.exports',
|
|
10
|
+
{
|
|
11
|
+
allowBatchAssign: false,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
|
|
15
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/file-extension-in-import.md
|
|
16
|
+
'n/file-extension-in-import': 'off', // handled by import/extensions
|
|
17
|
+
|
|
18
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/global-require.md
|
|
19
|
+
'n/global-require': 'error',
|
|
20
|
+
|
|
21
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/handle-callback-err.md
|
|
22
|
+
'n/handle-callback-err': 'off',
|
|
23
|
+
|
|
24
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/hashbang.md
|
|
25
|
+
'n/hashbang': 'off',
|
|
26
|
+
|
|
27
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-callback-literal.md
|
|
28
|
+
'n/no-callback-literal': 'off',
|
|
29
|
+
|
|
30
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-deprecated-api.md
|
|
31
|
+
'n/no-deprecated-api': 'error',
|
|
32
|
+
|
|
33
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-exports-assign.md
|
|
34
|
+
'n/no-exports-assign': 'error',
|
|
35
|
+
|
|
36
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-import.md
|
|
37
|
+
'n/no-extraneous-import': 'off', // handled by import/no-extraneous-dependencies
|
|
38
|
+
|
|
39
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-require.md
|
|
40
|
+
'n/no-extraneous-require': 'off',
|
|
41
|
+
|
|
42
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-import.md
|
|
43
|
+
'n/no-missing-import': 'off', // handled by import/no-unresolved
|
|
44
|
+
|
|
45
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-require.md
|
|
46
|
+
'n/no-missing-require': 'off', // handled by import/no-unresolved
|
|
47
|
+
|
|
48
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-mixed-requires.md
|
|
49
|
+
'n/no-mixed-requires': 'off',
|
|
50
|
+
|
|
51
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-new-require.md
|
|
52
|
+
'n/no-new-require': 'error',
|
|
53
|
+
|
|
54
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-path-concat.md
|
|
55
|
+
'n/no-path-concat': 'error',
|
|
56
|
+
|
|
57
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-env.md
|
|
58
|
+
'n/no-process-env': 'off',
|
|
59
|
+
|
|
60
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-exit.md
|
|
61
|
+
'n/no-process-exit': 'off',
|
|
62
|
+
|
|
63
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-import.md
|
|
64
|
+
'n/no-restricted-import': 'off',
|
|
65
|
+
|
|
66
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-require.md
|
|
67
|
+
'n/no-restricted-require': 'off',
|
|
68
|
+
|
|
69
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-sync.md
|
|
70
|
+
'n/no-sync': 'off',
|
|
71
|
+
|
|
72
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-top-level-await.md
|
|
73
|
+
'n/no-top-level-await': 'off',
|
|
74
|
+
|
|
75
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-bin.md
|
|
76
|
+
'n/no-unpublished-bin': 'error',
|
|
77
|
+
|
|
78
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-import.md
|
|
79
|
+
'n/no-unpublished-import': 'off',
|
|
80
|
+
|
|
81
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-require.md
|
|
82
|
+
'n/no-unpublished-require': 'off',
|
|
83
|
+
|
|
84
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-builtins.md
|
|
85
|
+
'n/no-unsupported-features/es-builtins': 'error',
|
|
86
|
+
|
|
87
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-syntax.md
|
|
88
|
+
'n/no-unsupported-features/es-syntax': 'error',
|
|
89
|
+
|
|
90
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/node-builtins.md
|
|
91
|
+
'n/no-unsupported-features/node-builtins': 'error',
|
|
92
|
+
|
|
93
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/buffer.md
|
|
94
|
+
'n/prefer-global/buffer': 'error',
|
|
95
|
+
|
|
96
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/console.md
|
|
97
|
+
'n/prefer-global/console': 'error',
|
|
98
|
+
|
|
99
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/process.md
|
|
100
|
+
'n/prefer-global/process': 'error',
|
|
101
|
+
|
|
102
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-decoder.md
|
|
103
|
+
'n/prefer-global/text-decoder': 'error',
|
|
104
|
+
|
|
105
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-encoder.md
|
|
106
|
+
'n/prefer-global/text-encoder': 'error',
|
|
107
|
+
|
|
108
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url.md
|
|
109
|
+
'n/prefer-global/url': 'error',
|
|
110
|
+
|
|
111
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url-search-params.md
|
|
112
|
+
'n/prefer-global/url-search-params': 'error',
|
|
113
|
+
|
|
114
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-node-protocol.md
|
|
115
|
+
'n/prefer-node-protocol': 'off', // handled by unicorn/prefer-node-protocol
|
|
116
|
+
|
|
117
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-promises/dns.md
|
|
118
|
+
'n/prefer-promises/dns': 'off',
|
|
119
|
+
|
|
120
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-promises/fs.md
|
|
121
|
+
'n/prefer-promises/fs': 'off',
|
|
122
|
+
|
|
123
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/process-exit-as-throw.md
|
|
124
|
+
'n/process-exit-as-throw': 'error',
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default getNodePluginRules;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const getReactHooksPluginRules = () => {
|
|
2
|
+
return {
|
|
3
|
+
// https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
|
|
4
|
+
// Core hooks rules
|
|
5
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
6
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
7
|
+
|
|
8
|
+
// React Compiler rules
|
|
9
|
+
'react-hooks/config': 'error',
|
|
10
|
+
'react-hooks/error-boundaries': 'error',
|
|
11
|
+
'react-hooks/component-hook-factories': 'error',
|
|
12
|
+
'react-hooks/gating': 'error',
|
|
13
|
+
'react-hooks/globals': 'error',
|
|
14
|
+
'react-hooks/immutability': 'error',
|
|
15
|
+
'react-hooks/preserve-manual-memoization': 'error',
|
|
16
|
+
'react-hooks/purity': 'error',
|
|
17
|
+
'react-hooks/refs': 'error',
|
|
18
|
+
'react-hooks/set-state-in-effect': 'warn',
|
|
19
|
+
'react-hooks/set-state-in-render': 'error',
|
|
20
|
+
'react-hooks/static-components': 'error',
|
|
21
|
+
'react-hooks/unsupported-syntax': 'warn',
|
|
22
|
+
'react-hooks/use-memo': 'error',
|
|
23
|
+
'react-hooks/incompatible-library': 'warn',
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default getReactHooksPluginRules;
|