@pumpn/eslint-config 16.1.2 → 16.2.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/config.js +1 -0
- package/deno.json +18 -14
- package/deno.lock +306 -272
- package/package.json +16 -12
- package/plugins.js +16 -14
- package/rules/import-x/static-analysis.js +1 -1
- package/rules/jsdoc.js +75 -13
- package/rules/perfectionist.js +178 -55
- package/rules/react/core.js +24 -10
- package/rules/react/dom.js +4 -2
- package/rules/react/hooks-extra.js +1 -5
- package/rules/react/naming-convention.js +8 -1
- package/rules/stylistic/jsx.js +0 -7
- package/rules/stylistic/spacing.js +1 -7
- package/rules/suggestions.js +1 -0
- package/rules/unicorn.js +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pumpn/eslint-config",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.2.0",
|
|
4
4
|
"description": "standard eslint config for pumpn code projects",
|
|
5
5
|
"main": "config.js",
|
|
6
6
|
"author": "Nano Miratus <nanomiratus@gmail.com>",
|
|
@@ -17,28 +17,32 @@
|
|
|
17
17
|
"test": "echo 'no tests yet'"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"eslint": "^9.
|
|
20
|
+
"eslint": "^9.39.2"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"@typescript-eslint/parser": "^8.42.0",
|
|
23
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
|
|
24
|
+
"@stylistic/eslint-plugin": "^5.7.0",
|
|
25
|
+
"@typescript-eslint/parser": "^8.53.0",
|
|
27
26
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
28
|
-
"eslint-plugin-command": "^3.
|
|
29
|
-
"eslint-plugin-depend": "^1.
|
|
27
|
+
"eslint-plugin-command": "^3.4.0",
|
|
28
|
+
"eslint-plugin-depend": "^1.4.0",
|
|
30
29
|
"eslint-plugin-import-x": "^4.16.1",
|
|
31
|
-
"eslint-plugin-jsdoc": "^
|
|
30
|
+
"eslint-plugin-jsdoc": "^62.1.0",
|
|
32
31
|
"eslint-plugin-no-secrets": "^2.2.1",
|
|
33
|
-
"eslint-plugin-perfectionist": "^
|
|
32
|
+
"eslint-plugin-perfectionist": "^5.3.1",
|
|
34
33
|
"eslint-plugin-promise": "^7.2.1",
|
|
34
|
+
"eslint-plugin-react-dom": "^2.7.2",
|
|
35
|
+
"eslint-plugin-react-hooks-extra": "^2.7.2",
|
|
36
|
+
"eslint-plugin-react-naming-convention": "^2.7.2",
|
|
37
|
+
"eslint-plugin-react-web-api": "^2.7.2",
|
|
38
|
+
"eslint-plugin-react-x": "^2.7.2",
|
|
35
39
|
"eslint-plugin-redos": "^4.5.0",
|
|
36
40
|
"eslint-plugin-regexp": "^2.10.0",
|
|
37
41
|
"eslint-plugin-security": "^3.0.1",
|
|
38
42
|
"eslint-plugin-sonarjs": "^3.0.5",
|
|
39
43
|
"eslint-plugin-tailwindcss": "^4.0.0-beta.0",
|
|
40
|
-
"eslint-plugin-unicorn": "^
|
|
41
|
-
"globals": "^
|
|
44
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
45
|
+
"globals": "^17.0.0"
|
|
42
46
|
},
|
|
43
47
|
"peerDependencies": {
|
|
44
48
|
"eslint": "^9.34.0"
|
package/plugins.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
// TODO [
|
|
2
|
-
/* eslint-disable
|
|
1
|
+
// TODO [2026-07-01]: Remove the directive below once this is resolved: https://github.com/eslint-community/eslint-plugin-eslint-comments/pull/246#issuecomment-3764843636
|
|
2
|
+
/* eslint-disable import-x/default -- see above */
|
|
3
3
|
/* eslint-disable import-x/max-dependencies -- collection file */
|
|
4
4
|
|
|
5
5
|
// import github from "eslint-plugin-github";
|
|
6
6
|
// import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
7
7
|
// import noUnsanitized from "eslint-plugin-no-unsanitized";
|
|
8
8
|
import eslintComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
9
|
-
import react from "@eslint-react/eslint-plugin";
|
|
10
9
|
import stylistic from "@stylistic/eslint-plugin";
|
|
11
10
|
import command from "eslint-plugin-command";
|
|
12
11
|
import depend from "eslint-plugin-depend";
|
|
@@ -15,6 +14,11 @@ import jsdoc from "eslint-plugin-jsdoc";
|
|
|
15
14
|
import noSecrets from "eslint-plugin-no-secrets";
|
|
16
15
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
17
16
|
import promise from "eslint-plugin-promise";
|
|
17
|
+
import reactDom from "eslint-plugin-react-dom";
|
|
18
|
+
import reactHooksExtra from "eslint-plugin-react-hooks-extra";
|
|
19
|
+
import reactNamingConvention from "eslint-plugin-react-naming-convention";
|
|
20
|
+
import reactWebApi from "eslint-plugin-react-web-api";
|
|
21
|
+
import react from "eslint-plugin-react-x";
|
|
18
22
|
import redos from "eslint-plugin-redos";
|
|
19
23
|
import * as regexp from "eslint-plugin-regexp";
|
|
20
24
|
import security from "eslint-plugin-security";
|
|
@@ -26,10 +30,6 @@ import unicorn from "eslint-plugin-unicorn";
|
|
|
26
30
|
* @import { Linter, ESLint } from "eslint"
|
|
27
31
|
*/
|
|
28
32
|
|
|
29
|
-
const reactPlugins = /** @type {Record<string, ESLint.Plugin>} */ (
|
|
30
|
-
/** @type {unknown} */ (react.configs.all.plugins)
|
|
31
|
-
);
|
|
32
|
-
|
|
33
33
|
/**
|
|
34
34
|
* @satisfies { Linter.Config["plugins"] }
|
|
35
35
|
*/
|
|
@@ -41,7 +41,13 @@ const plugins = /** @type {const} */ ({
|
|
|
41
41
|
"@stylistic": stylistic,
|
|
42
42
|
command,
|
|
43
43
|
depend,
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
"@eslint-react": react,
|
|
46
|
+
"@eslint-react/dom": reactDom,
|
|
47
|
+
"@eslint-react/hooks-extra": reactHooksExtra,
|
|
48
|
+
"@eslint-react/naming-convention": reactNamingConvention,
|
|
49
|
+
"@eslint-react/web-api": reactWebApi,
|
|
50
|
+
// TODO [2026-07-01]: Remove assertion once https://github.com/un-ts/eslint-plugin-import-x/issues/421 is resolved
|
|
45
51
|
"import-x": /** @type {ESLint.Plugin} */ (
|
|
46
52
|
/** @type {unknown} */ (
|
|
47
53
|
importX
|
|
@@ -54,13 +60,9 @@ const plugins = /** @type {const} */ ({
|
|
|
54
60
|
redos,
|
|
55
61
|
regexp,
|
|
56
62
|
security,
|
|
57
|
-
|
|
58
|
-
sonarjs: /** @type {ESLint.Plugin} */ (
|
|
59
|
-
sonarjs
|
|
60
|
-
),
|
|
63
|
+
sonarjs,
|
|
61
64
|
tailwindcss,
|
|
62
|
-
unicorn
|
|
63
|
-
...reactPlugins
|
|
65
|
+
unicorn
|
|
64
66
|
});
|
|
65
67
|
|
|
66
68
|
export default plugins;
|
|
@@ -57,7 +57,7 @@ const staticAnalysisRules = {
|
|
|
57
57
|
}
|
|
58
58
|
],
|
|
59
59
|
"import-x/no-self-import": "error",
|
|
60
|
-
// TODO [
|
|
60
|
+
// TODO [2026-07-01]: Change to "error" when there is a resolver for deno (maybe https://github.com/redabacha/eslint-import-resolver-deno)
|
|
61
61
|
"import-x/no-unresolved": "off",
|
|
62
62
|
"import-x/no-useless-path-segments": [
|
|
63
63
|
"error",
|
package/rules/jsdoc.js
CHANGED
|
@@ -7,20 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
const jsdocRules = {
|
|
9
9
|
"jsdoc/check-access": "warn",
|
|
10
|
-
"jsdoc/check-alignment": "warn",
|
|
11
|
-
"jsdoc/check-examples": [
|
|
12
|
-
"off",
|
|
13
|
-
{
|
|
14
|
-
allowInlineConfig: true,
|
|
15
|
-
captionRequired: false,
|
|
16
|
-
noDefaultExampleRules: true,
|
|
17
|
-
paddedIndent: 4,
|
|
18
|
-
reportUnusedDisableDirectives: true
|
|
19
|
-
}
|
|
20
|
-
],
|
|
10
|
+
"jsdoc/check-alignment": ["warn", { innerIndent: 1 }],
|
|
21
11
|
"jsdoc/check-indentation": [
|
|
22
12
|
"warn",
|
|
23
13
|
{
|
|
14
|
+
allowIndentedSections: true,
|
|
24
15
|
excludeTags: ["example", "typedef"]
|
|
25
16
|
}
|
|
26
17
|
],
|
|
@@ -31,7 +22,13 @@ const jsdocRules = {
|
|
|
31
22
|
"jsdoc/check-tag-names": [
|
|
32
23
|
"warn",
|
|
33
24
|
{
|
|
34
|
-
definedTags: ["category", "component"]
|
|
25
|
+
definedTags: ["category", "component"],
|
|
26
|
+
inlineTags: [
|
|
27
|
+
"link",
|
|
28
|
+
"linkcode",
|
|
29
|
+
"linkplain",
|
|
30
|
+
"tutorial"
|
|
31
|
+
]
|
|
35
32
|
}
|
|
36
33
|
],
|
|
37
34
|
"jsdoc/check-template-names": "off",
|
|
@@ -56,6 +53,14 @@ const jsdocRules = {
|
|
|
56
53
|
}
|
|
57
54
|
],
|
|
58
55
|
"jsdoc/empty-tags": "warn",
|
|
56
|
+
"jsdoc/escape-inline-tags": [
|
|
57
|
+
"warn",
|
|
58
|
+
{
|
|
59
|
+
allowedInlineTags: [],
|
|
60
|
+
enableFixer: true,
|
|
61
|
+
fixType: "backslash"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
59
64
|
"jsdoc/implements-on-classes": "warn",
|
|
60
65
|
"jsdoc/imports-as-dependencies": "off",
|
|
61
66
|
"jsdoc/informative-docs": "warn",
|
|
@@ -81,9 +86,20 @@ const jsdocRules = {
|
|
|
81
86
|
"jsdoc/no-undefined-types": [
|
|
82
87
|
"off",
|
|
83
88
|
{
|
|
89
|
+
checkUsedTypedefs: true,
|
|
84
90
|
definedTypes: ["Iterable", "IterableIterator"]
|
|
85
91
|
}
|
|
86
92
|
],
|
|
93
|
+
"jsdoc/prefer-import-tag": [
|
|
94
|
+
"warn",
|
|
95
|
+
{
|
|
96
|
+
enableFixer: true,
|
|
97
|
+
exemptTypedefs: false,
|
|
98
|
+
outputType: "named-import"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"jsdoc/reject-any-type": "warn",
|
|
102
|
+
"jsdoc/reject-function-type": "warn",
|
|
87
103
|
"jsdoc/require-asterisk-prefix": [
|
|
88
104
|
"warn",
|
|
89
105
|
"always",
|
|
@@ -164,6 +180,8 @@ const jsdocRules = {
|
|
|
164
180
|
],
|
|
165
181
|
"jsdoc/require-hyphen-before-param-description": ["warn", "always"],
|
|
166
182
|
"jsdoc/require-jsdoc": "off",
|
|
183
|
+
"jsdoc/require-next-description": "warn",
|
|
184
|
+
"jsdoc/require-next-type": "warn",
|
|
167
185
|
"jsdoc/require-param": ["warn", { unnamedRootBase: ["options"] }],
|
|
168
186
|
"jsdoc/require-param-description": [
|
|
169
187
|
"warn",
|
|
@@ -177,6 +195,7 @@ const jsdocRules = {
|
|
|
177
195
|
"jsdoc/require-property-description": "warn",
|
|
178
196
|
"jsdoc/require-property-name": "warn",
|
|
179
197
|
"jsdoc/require-property-type": "warn",
|
|
198
|
+
"jsdoc/require-rejects": "off",
|
|
180
199
|
"jsdoc/require-returns": "warn",
|
|
181
200
|
"jsdoc/require-returns-check": "warn",
|
|
182
201
|
"jsdoc/require-returns-description": "warn",
|
|
@@ -187,9 +206,14 @@ const jsdocRules = {
|
|
|
187
206
|
requireSeparateTemplates: true
|
|
188
207
|
}
|
|
189
208
|
],
|
|
209
|
+
"jsdoc/require-template-description": "off",
|
|
190
210
|
"jsdoc/require-throws": "warn",
|
|
211
|
+
"jsdoc/require-throws-description": "warn",
|
|
212
|
+
"jsdoc/require-throws-type": "warn",
|
|
191
213
|
"jsdoc/require-yields": "warn",
|
|
192
214
|
"jsdoc/require-yields-check": "warn",
|
|
215
|
+
"jsdoc/require-yields-description": "warn",
|
|
216
|
+
"jsdoc/require-yields-type": "warn",
|
|
193
217
|
"jsdoc/sort-tags": [
|
|
194
218
|
"warn",
|
|
195
219
|
{
|
|
@@ -363,7 +387,45 @@ const jsdocRules = {
|
|
|
363
387
|
}
|
|
364
388
|
],
|
|
365
389
|
"jsdoc/text-escaping": "off",
|
|
366
|
-
"jsdoc/
|
|
390
|
+
"jsdoc/ts-method-signature-style": ["warn", "property", { enableFixer: true }],
|
|
391
|
+
"jsdoc/ts-no-empty-object-type": "warn",
|
|
392
|
+
"jsdoc/ts-no-unnecessary-template-expression": ["warn", { enableFixer: true }],
|
|
393
|
+
"jsdoc/ts-prefer-function-type": ["warn", { enableFixer: true }],
|
|
394
|
+
"jsdoc/type-formatting": [
|
|
395
|
+
"warn",
|
|
396
|
+
{
|
|
397
|
+
arrayBrackets: "square",
|
|
398
|
+
arrowFunctionPostReturnMarkerSpacing: " ",
|
|
399
|
+
arrowFunctionPreReturnMarkerSpacing: " ",
|
|
400
|
+
enableFixer: true,
|
|
401
|
+
functionOrClassParameterSpacing: " ",
|
|
402
|
+
functionOrClassPostGenericSpacing: "",
|
|
403
|
+
functionOrClassPostReturnMarkerSpacing: "",
|
|
404
|
+
functionOrClassPreReturnMarkerSpacing: "",
|
|
405
|
+
functionOrClassTypeParameterSpacing: " ",
|
|
406
|
+
genericAndTupleElementSpacing: " ",
|
|
407
|
+
genericDot: false,
|
|
408
|
+
keyValuePostColonSpacing: " ",
|
|
409
|
+
keyValuePostKeySpacing: "",
|
|
410
|
+
keyValuePostOptionalSpacing: "",
|
|
411
|
+
keyValuePostVariadicSpacing: "",
|
|
412
|
+
methodQuotes: "double",
|
|
413
|
+
objectFieldIndent: "\t",
|
|
414
|
+
objectFieldQuote: null,
|
|
415
|
+
objectFieldSeparator: "comma-and-linebreak",
|
|
416
|
+
objectFieldSeparatorOptionalLinebreak: true,
|
|
417
|
+
objectFieldSeparatorTrailingPunctuation: false,
|
|
418
|
+
parameterDefaultValueSpacing: " ",
|
|
419
|
+
postMethodNameSpacing: "",
|
|
420
|
+
postNewSpacing: " ",
|
|
421
|
+
separatorForSingleObjectField: false,
|
|
422
|
+
stringQuotes: "double",
|
|
423
|
+
typeBracketSpacing: "",
|
|
424
|
+
unionSpacing: " "
|
|
425
|
+
}
|
|
426
|
+
],
|
|
427
|
+
"jsdoc/valid-types": "off",
|
|
428
|
+
"jsodc/require-tags": "off"
|
|
367
429
|
};
|
|
368
430
|
|
|
369
431
|
export default jsdocRules;
|
package/rules/perfectionist.js
CHANGED
|
@@ -9,7 +9,6 @@ const perfectionistRules = {
|
|
|
9
9
|
"perfectionist/sort-array-includes": [
|
|
10
10
|
"error",
|
|
11
11
|
{
|
|
12
|
-
groupKind: "mixed",
|
|
13
12
|
groups: ["literal", "spread"]
|
|
14
13
|
}
|
|
15
14
|
],
|
|
@@ -46,22 +45,39 @@ const perfectionistRules = {
|
|
|
46
45
|
],
|
|
47
46
|
"perfectionist/sort-decorators": "error",
|
|
48
47
|
"perfectionist/sort-enums": "error",
|
|
48
|
+
"perfectionist/sort-export-attributes": "error",
|
|
49
49
|
"perfectionist/sort-exports": "error",
|
|
50
50
|
"perfectionist/sort-heritage-clauses": "error",
|
|
51
|
+
"perfectionist/sort-import-attributes": "error",
|
|
51
52
|
"perfectionist/sort-imports": [
|
|
52
53
|
"error",
|
|
53
54
|
{
|
|
54
|
-
customGroups:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
customGroups: [
|
|
56
|
+
{
|
|
57
|
+
elementNamePattern: "^@/components/.*",
|
|
58
|
+
groupName: "components"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
elementNamePattern: "^@/islands/.*",
|
|
62
|
+
groupName: "islands"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
elementNamePattern: "^@/logic/.*",
|
|
66
|
+
groupName: "logic"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
elementNamePattern: "^@/plugins/.*",
|
|
70
|
+
groupName: "plugins"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
elementNamePattern: "^@std/.*",
|
|
74
|
+
groupName: "std"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
elementNamePattern: "^@/utilities/.*",
|
|
78
|
+
groupName: "utilities"
|
|
63
79
|
}
|
|
64
|
-
|
|
80
|
+
],
|
|
65
81
|
groups: [
|
|
66
82
|
"builtin",
|
|
67
83
|
"std",
|
|
@@ -73,18 +89,17 @@ const perfectionistRules = {
|
|
|
73
89
|
"islands",
|
|
74
90
|
"internal",
|
|
75
91
|
"type",
|
|
76
|
-
"internal
|
|
77
|
-
"parent
|
|
78
|
-
"sibling
|
|
79
|
-
"index
|
|
80
|
-
"object",
|
|
92
|
+
"type-internal",
|
|
93
|
+
"type-parent",
|
|
94
|
+
"type-sibling",
|
|
95
|
+
"type-index",
|
|
81
96
|
"parent",
|
|
82
97
|
"sibling",
|
|
83
98
|
"index",
|
|
84
99
|
"unknown"
|
|
85
100
|
],
|
|
86
101
|
internalPattern: ["^@/.+"],
|
|
87
|
-
newlinesBetween:
|
|
102
|
+
newlinesBetween: 1,
|
|
88
103
|
partitionByNewLine: false,
|
|
89
104
|
sortSideEffects: true
|
|
90
105
|
}
|
|
@@ -105,44 +120,152 @@ const perfectionistRules = {
|
|
|
105
120
|
"perfectionist/sort-objects": [
|
|
106
121
|
"error",
|
|
107
122
|
{
|
|
108
|
-
customGroups:
|
|
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
|
-
|
|
123
|
+
customGroups: [
|
|
124
|
+
{
|
|
125
|
+
elementNamePattern: ["^id$"],
|
|
126
|
+
groupName: "id"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
elementNamePattern: ["^before.*"],
|
|
130
|
+
groupName: "groupBeforeAfter1"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
elementNamePattern: ["^after.*"],
|
|
134
|
+
groupName: "groupBeforeAfter2"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
elementNamePattern: ["^r$", "^l$"],
|
|
138
|
+
groupName: "groupColor1"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
elementNamePattern: ["^g$", "^c$", "^a$"],
|
|
142
|
+
groupName: "groupColor2"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
elementNamePattern: ["^b$", "^h$"],
|
|
146
|
+
groupName: "groupColor3"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
elementNamePattern: ["^minimum(([A-Z].*)|$)"],
|
|
150
|
+
groupName: "groupMinimumMaximum1"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
elementNamePattern: ["^maximum(([A-Z].*)|$)"],
|
|
154
|
+
groupName: "groupMinimumMaximum2"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
elementNamePattern: ["^min(([A-Z_-].*)|$)"],
|
|
158
|
+
groupName: "groupMinMax1"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
elementNamePattern: ["^max(([A-Z_-].*)|$)"],
|
|
162
|
+
groupName: "groupMinMax2"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
elementNamePattern: ["^primary.*"],
|
|
166
|
+
groupName: "groupPrecedenceOrdinal1"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
elementNamePattern: ["^secondary.*"],
|
|
170
|
+
groupName: "groupPrecedenceOrdinal2"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
elementNamePattern: ["^tertiary.*"],
|
|
174
|
+
groupName: "groupPrecedenceOrdinal3"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
elementNamePattern: ["^quaternary.*"],
|
|
178
|
+
groupName: "groupPrecedenceOrdinal4"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
elementNamePattern: ["^quinary.*"],
|
|
182
|
+
groupName: "groupPrecedenceOrdinal5"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
elementNamePattern: ["^senary.*"],
|
|
186
|
+
groupName: "groupPrecedenceOrdinal6"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
elementNamePattern: ["^septenary.*"],
|
|
190
|
+
groupName: "groupPrecedenceOrdinal7"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
elementNamePattern: ["^octonary.*"],
|
|
194
|
+
groupName: "groupPrecedenceOrdinal8"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
elementNamePattern: ["^nonary.*"],
|
|
198
|
+
groupName: "groupPrecedenceOrdinal9"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
elementNamePattern: ["^denary.*"],
|
|
202
|
+
groupName: "groupPrecedenceOrdinal10"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
elementNamePattern: ["^ultimate.*"],
|
|
206
|
+
groupName: "groupPrecedenceOrdinalLast"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
elementNamePattern: ["^previous.*"],
|
|
210
|
+
groupName: "groupPreviousNext1"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
elementNamePattern: ["^next.*"],
|
|
214
|
+
groupName: "groupPreviousNext2"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
elementNamePattern: ["^prev(?!ent).*"],
|
|
218
|
+
groupName: "groupPrevNext1"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
elementNamePattern: ["^next.*"],
|
|
222
|
+
groupName: "groupPrevNext2"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
elementNamePattern: ["^first.*"],
|
|
226
|
+
groupName: "groupSpatialOrdinal1"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
elementNamePattern: ["^second.*"],
|
|
230
|
+
groupName: "groupSpatialOrdinal2"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
elementNamePattern: ["^third.*"],
|
|
234
|
+
groupName: "groupSpatialOrdinal3"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
elementNamePattern: ["^fourth.*"],
|
|
238
|
+
groupName: "groupSpatialOrdinal4"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
elementNamePattern: ["^fifth.*"],
|
|
242
|
+
groupName: "groupSpatialOrdinal5"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
elementNamePattern: ["^sixth.*"],
|
|
246
|
+
groupName: "groupSpatialOrdinal6"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
elementNamePattern: ["^seventh.*"],
|
|
250
|
+
groupName: "groupSpatialOrdinal7"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
elementNamePattern: ["^eighth.*"],
|
|
254
|
+
groupName: "groupSpatialOrdinal8"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
elementNamePattern: ["^ninth.*"],
|
|
258
|
+
groupName: "groupSpatialOrdinal9"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
elementNamePattern: ["^tenth.*"],
|
|
262
|
+
groupName: "groupSpatialOrdinal10"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
elementNamePattern: ["^last.*"],
|
|
266
|
+
groupName: "groupSpatialOrdinalLast"
|
|
267
|
+
}
|
|
268
|
+
],
|
|
146
269
|
groups: [
|
|
147
270
|
"id",
|
|
148
271
|
"groupBeforeAfter1",
|
package/rules/react/core.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
const coreRules = {
|
|
2
|
-
"@eslint-react/
|
|
3
|
-
"@eslint-react/
|
|
4
|
-
"@eslint-react/
|
|
2
|
+
"@eslint-react/jsx-dollar": "error",
|
|
3
|
+
"@eslint-react/jsx-key-before-spread": "error",
|
|
4
|
+
"@eslint-react/jsx-no-comment-textnodes": "error",
|
|
5
|
+
"@eslint-react/jsx-no-duplicate-props": "error",
|
|
6
|
+
"@eslint-react/jsx-shorthand-boolean": "error",
|
|
7
|
+
"@eslint-react/jsx-shorthand-fragment": "error",
|
|
8
|
+
"@eslint-react/jsx-uses-vars": "error",
|
|
5
9
|
"@eslint-react/no-access-state-in-setstate": "error",
|
|
6
10
|
"@eslint-react/no-array-index-key": "error",
|
|
7
11
|
"@eslint-react/no-children-count": "error",
|
|
@@ -12,8 +16,6 @@ const coreRules = {
|
|
|
12
16
|
"@eslint-react/no-children-to-array": "error",
|
|
13
17
|
"@eslint-react/no-class-component": "error",
|
|
14
18
|
"@eslint-react/no-clone-element": "error",
|
|
15
|
-
"@eslint-react/no-comment-textnodes": "error",
|
|
16
|
-
"@eslint-react/no-complex-conditional-rendering": "error",
|
|
17
19
|
"@eslint-react/no-component-will-mount": "error",
|
|
18
20
|
"@eslint-react/no-component-will-receive-props": "error",
|
|
19
21
|
"@eslint-react/no-component-will-update": "error",
|
|
@@ -25,26 +27,38 @@ const coreRules = {
|
|
|
25
27
|
"@eslint-react/no-leaked-conditional-rendering": "error",
|
|
26
28
|
"@eslint-react/no-missing-component-display-name": "error",
|
|
27
29
|
"@eslint-react/no-missing-key": "error",
|
|
28
|
-
"@eslint-react/no-nested-
|
|
30
|
+
"@eslint-react/no-nested-component-definitions": "error",
|
|
29
31
|
"@eslint-react/no-prop-types": "error",
|
|
30
32
|
"@eslint-react/no-redundant-should-component-update": "error",
|
|
31
33
|
"@eslint-react/no-set-state-in-component-did-mount": "error",
|
|
32
34
|
"@eslint-react/no-set-state-in-component-did-update": "error",
|
|
33
35
|
"@eslint-react/no-set-state-in-component-will-update": "error",
|
|
34
36
|
"@eslint-react/no-string-refs": "error",
|
|
37
|
+
"@eslint-react/no-unnecessary-key": "error",
|
|
38
|
+
"@eslint-react/no-unnecessary-use-callback": "error",
|
|
39
|
+
"@eslint-react/no-unnecessary-use-memo": "error",
|
|
40
|
+
"@eslint-react/no-unnecessary-use-prefix": "error",
|
|
41
|
+
"@eslint-react/no-unnecessary-use-ref": "error",
|
|
35
42
|
"@eslint-react/no-unsafe-component-will-mount": "error",
|
|
36
43
|
"@eslint-react/no-unsafe-component-will-receive-props": "error",
|
|
37
44
|
"@eslint-react/no-unsafe-component-will-update": "error",
|
|
38
45
|
"@eslint-react/no-unstable-context-value": "error",
|
|
39
46
|
"@eslint-react/no-unstable-default-props": "error",
|
|
40
47
|
"@eslint-react/no-unused-class-component-members": "error",
|
|
48
|
+
"@eslint-react/no-unused-props": "error",
|
|
41
49
|
"@eslint-react/no-unused-state": "error",
|
|
42
|
-
"@eslint-react/no-useless-
|
|
50
|
+
"@eslint-react/no-useless-forward-ref": "error",
|
|
51
|
+
"@eslint-react/no-useless-fragment": [
|
|
52
|
+
"error",
|
|
53
|
+
{
|
|
54
|
+
allowEmptyFragment: false,
|
|
55
|
+
allowExpressions: true
|
|
56
|
+
}
|
|
57
|
+
],
|
|
43
58
|
"@eslint-react/prefer-destructuring-assignment": "error",
|
|
44
|
-
"@eslint-react/prefer-
|
|
59
|
+
"@eslint-react/prefer-namespace-import": "error",
|
|
45
60
|
"@eslint-react/prefer-read-only-props": "error",
|
|
46
|
-
"@eslint-react/prefer-
|
|
47
|
-
"@eslint-react/prefer-shorthand-fragment": "error"
|
|
61
|
+
"@eslint-react/prefer-use-state-lazy-initialization": "error"
|
|
48
62
|
};
|
|
49
63
|
|
|
50
64
|
export default coreRules;
|
package/rules/react/dom.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const domRules = {
|
|
2
|
-
"@eslint-react/dom/no-children-in-void-dom-elements": "error",
|
|
3
2
|
"@eslint-react/dom/no-dangerously-set-innerhtml": "error",
|
|
4
3
|
"@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
5
4
|
"@eslint-react/dom/no-find-dom-node": "error",
|
|
@@ -8,8 +7,11 @@ const domRules = {
|
|
|
8
7
|
"@eslint-react/dom/no-namespace": "error",
|
|
9
8
|
"@eslint-react/dom/no-render-return-value": "error",
|
|
10
9
|
"@eslint-react/dom/no-script-url": "error",
|
|
10
|
+
"@eslint-react/dom/no-string-style-prop": "error",
|
|
11
11
|
"@eslint-react/dom/no-unsafe-iframe-sandbox": "error",
|
|
12
|
-
"@eslint-react/dom/no-unsafe-target-blank": "error"
|
|
12
|
+
"@eslint-react/dom/no-unsafe-target-blank": "error",
|
|
13
|
+
"@eslint-react/dom/no-void-elements-with-children": "error",
|
|
14
|
+
"@eslint-react/dom/prefer-namespace-import": "error"
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export default domRules;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
const hooksExtraRules = {
|
|
2
|
-
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "error"
|
|
3
|
-
"@eslint-react/hooks-extra/no-redundant-custom-hook": "error",
|
|
4
|
-
"@eslint-react/hooks-extra/no-unnecessary-use-callback": "error",
|
|
5
|
-
"@eslint-react/hooks-extra/no-unnecessary-use-memo": "error",
|
|
6
|
-
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "error"
|
|
2
|
+
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "error"
|
|
7
3
|
};
|
|
8
4
|
|
|
9
5
|
export default hooksExtraRules;
|
|
@@ -15,7 +15,14 @@ const namingConventionRules = {
|
|
|
15
15
|
extensions: [".jsx", ".tsx"]
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
|
-
"@eslint-react/naming-convention/
|
|
18
|
+
"@eslint-react/naming-convention/ref-name": "off",
|
|
19
|
+
"@eslint-react/naming-convention/use-state": [
|
|
20
|
+
"error",
|
|
21
|
+
{
|
|
22
|
+
enforceAssignment: false,
|
|
23
|
+
enforceSetterName: true
|
|
24
|
+
}
|
|
25
|
+
]
|
|
19
26
|
};
|
|
20
27
|
|
|
21
28
|
export default namingConventionRules;
|