@pumpn/eslint-config 16.2.1 → 17.0.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 +26 -22
- package/deno.lock +293 -435
- package/eslint.config.js +0 -15
- package/package.json +22 -22
- package/plugins.js +4 -14
- package/rules/_exports.js +1 -5
- package/rules/eslint-comments/best-practices.js +0 -1
- package/rules/import-x/helpful-warnings.js +1 -0
- package/rules/jsdoc.js +2 -0
- package/rules/perfectionist.js +3 -2
- package/rules/react/_exports.js +1 -1
- package/rules/react/core.js +24 -10
- package/rules/react/naming-convention.js +2 -24
- package/rules/react/rsc.js +5 -0
- package/rules/regexp/stylistic-issues.js +2 -2
- package/rules/sonarjs/_exports.js +2 -2
- package/rules/sonarjs/problem.js +122 -0
- package/rules/sonarjs/suggestion.js +135 -0
- package/rules/stylistic/jsx.js +11 -0
- package/rules/stylistic/spacing.js +15 -0
- package/rules/suggestions.js +15 -1
- package/rules/unicorn.js +9 -0
- package/rules/github.js +0 -34
- package/rules/jsx-a11y.js +0 -146
- package/rules/no-unsanitized.js +0 -13
- package/rules/react/hooks-extra.js +0 -5
- package/rules/redos.js +0 -22
- package/rules/sonarjs/bug-detection.js +0 -13
- package/rules/sonarjs/code-smell-detection.js +0 -37
package/rules/suggestions.js
CHANGED
|
@@ -162,7 +162,21 @@ const suggestionsRules = {
|
|
|
162
162
|
"no-restricted-globals": "error",
|
|
163
163
|
"no-restricted-imports": "error",
|
|
164
164
|
"no-restricted-properties": "error",
|
|
165
|
-
"no-restricted-syntax":
|
|
165
|
+
"no-restricted-syntax": [
|
|
166
|
+
"error",
|
|
167
|
+
{
|
|
168
|
+
message: "[Deprecated] Use ES6 default parameters instead.",
|
|
169
|
+
selector: "AssignmentExpression[operator='='][left.property.name='defaultProps']"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
message: "[Deprecated] Use TypeScript or another type-checking solution instead.",
|
|
173
|
+
selector: "AssignmentExpression[operator='='][left.property.name='propTypes']"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
message: "[Deprecated] Use callback refs instead.",
|
|
177
|
+
selector: "JSXAttribute[name.name='ref'][value.type='Literal']"
|
|
178
|
+
}
|
|
179
|
+
],
|
|
166
180
|
"no-return-assign": "error",
|
|
167
181
|
"no-script-url": "error",
|
|
168
182
|
"no-sequences": "error",
|
package/rules/unicorn.js
CHANGED
|
@@ -59,6 +59,15 @@ const unicornRules = {
|
|
|
59
59
|
"unicorn/explicit-length-check": "error",
|
|
60
60
|
"unicorn/filename-case": ["error", { case: "kebabCase" }],
|
|
61
61
|
"unicorn/import-style": "error",
|
|
62
|
+
"unicorn/isolated-functions": [
|
|
63
|
+
"error",
|
|
64
|
+
{
|
|
65
|
+
comments: ["@isolated"],
|
|
66
|
+
functions: ["makeSynchronous"],
|
|
67
|
+
overrideGlobals: undefined,
|
|
68
|
+
selectors: []
|
|
69
|
+
}
|
|
70
|
+
],
|
|
62
71
|
"unicorn/new-for-builtins": "error",
|
|
63
72
|
"unicorn/no-abusive-eslint-disable": "error",
|
|
64
73
|
"unicorn/no-accessor-recursion": "error",
|
package/rules/github.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @import { Linter } from "eslint";
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @satisfies {Linter.RulesRecord}
|
|
7
|
-
*/
|
|
8
|
-
const githubRules = {
|
|
9
|
-
"github/a11y-aria-label-is-well-formatted": "error",
|
|
10
|
-
"github/a11y-no-title-attribute": "error",
|
|
11
|
-
"github/a11y-no-visually-hidden-interactive-element": "error",
|
|
12
|
-
"github/a11y-role-supports-aria-props": "error",
|
|
13
|
-
"github/a11y-svg-has-accessible-name": "error",
|
|
14
|
-
"github/array-foreach": "error",
|
|
15
|
-
"github/async-currenttarget": "error",
|
|
16
|
-
"github/async-preventdefault": "error",
|
|
17
|
-
"github/authenticity-token": "error",
|
|
18
|
-
"github/get-attribute": "error",
|
|
19
|
-
"github/js-class-name": "error",
|
|
20
|
-
"github/no-blur": "error",
|
|
21
|
-
"github/no-d-none": "error",
|
|
22
|
-
"github/no-dataset": "off",
|
|
23
|
-
"github/no-dynamic-script-tag": "error",
|
|
24
|
-
"github/no-implicit-buggy-globals": "off",
|
|
25
|
-
"github/no-inner-html": "error",
|
|
26
|
-
"github/no-innerText": "error",
|
|
27
|
-
"github/no-then": "error",
|
|
28
|
-
"github/no-useless-passive": "error",
|
|
29
|
-
"github/prefer-observers": "error",
|
|
30
|
-
"github/require-passive-events": "error",
|
|
31
|
-
"github/unescaped-html-literal": "error"
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default githubRules;
|
package/rules/jsx-a11y.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @import { Linter } from "eslint";
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @satisfies {Linter.RulesRecord}
|
|
7
|
-
*/
|
|
8
|
-
const jsxA11yRules = {
|
|
9
|
-
"jsx-a11y/alt-text": "error",
|
|
10
|
-
"jsx-a11y/anchor-ambiguous-text": [
|
|
11
|
-
"error",
|
|
12
|
-
{
|
|
13
|
-
words: [
|
|
14
|
-
"this",
|
|
15
|
-
"more",
|
|
16
|
-
"read here",
|
|
17
|
-
"read more"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"jsx-a11y/anchor-has-content": "error",
|
|
22
|
-
"jsx-a11y/anchor-is-valid": "error",
|
|
23
|
-
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
24
|
-
"jsx-a11y/aria-props": "error",
|
|
25
|
-
"jsx-a11y/aria-proptypes": "error",
|
|
26
|
-
"jsx-a11y/aria-role": "error",
|
|
27
|
-
"jsx-a11y/aria-unsupported-elements": "error",
|
|
28
|
-
"jsx-a11y/autocomplete-valid": "error",
|
|
29
|
-
"jsx-a11y/click-events-have-key-events": "error",
|
|
30
|
-
"jsx-a11y/control-has-associated-label": [
|
|
31
|
-
"error",
|
|
32
|
-
{
|
|
33
|
-
ignoreElements: [
|
|
34
|
-
"audio",
|
|
35
|
-
"canvas",
|
|
36
|
-
"embed",
|
|
37
|
-
"input",
|
|
38
|
-
"textarea",
|
|
39
|
-
"tr",
|
|
40
|
-
"video"
|
|
41
|
-
],
|
|
42
|
-
ignoreRoles: [
|
|
43
|
-
"grid",
|
|
44
|
-
"listbox",
|
|
45
|
-
"menu",
|
|
46
|
-
"menubar",
|
|
47
|
-
"radiogroup",
|
|
48
|
-
"row",
|
|
49
|
-
"tablist",
|
|
50
|
-
"toolbar",
|
|
51
|
-
"tree",
|
|
52
|
-
"treegrid"
|
|
53
|
-
],
|
|
54
|
-
includeRoles: ["alert", "dialog"]
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
"jsx-a11y/heading-has-content": "error",
|
|
58
|
-
"jsx-a11y/html-has-lang": "error",
|
|
59
|
-
"jsx-a11y/iframe-has-title": "error",
|
|
60
|
-
"jsx-a11y/img-redundant-alt": "error",
|
|
61
|
-
"jsx-a11y/interactive-supports-focus": [
|
|
62
|
-
"error",
|
|
63
|
-
{
|
|
64
|
-
tabbable: [
|
|
65
|
-
"button",
|
|
66
|
-
"checkbox",
|
|
67
|
-
"link",
|
|
68
|
-
"progressbar",
|
|
69
|
-
"searchbox",
|
|
70
|
-
"slider",
|
|
71
|
-
"spinbutton",
|
|
72
|
-
"switch",
|
|
73
|
-
"textbox"
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
"jsx-a11y/label-has-associated-control": "error",
|
|
78
|
-
"jsx-a11y/lang": "error",
|
|
79
|
-
"jsx-a11y/media-has-caption": "error",
|
|
80
|
-
"jsx-a11y/mouse-events-have-key-events": "error",
|
|
81
|
-
"jsx-a11y/no-access-key": "error",
|
|
82
|
-
"jsx-a11y/no-aria-hidden-on-focusable": "error",
|
|
83
|
-
"jsx-a11y/no-autofocus": "off",
|
|
84
|
-
"jsx-a11y/no-distracting-elements": "error",
|
|
85
|
-
"jsx-a11y/no-interactive-element-to-noninteractive-role": [
|
|
86
|
-
"error",
|
|
87
|
-
{
|
|
88
|
-
canvas: ["img"],
|
|
89
|
-
td: ["cell"],
|
|
90
|
-
tr: ["none", "presentation"]
|
|
91
|
-
}
|
|
92
|
-
],
|
|
93
|
-
"jsx-a11y/no-noninteractive-element-interactions": [
|
|
94
|
-
"error",
|
|
95
|
-
{
|
|
96
|
-
body: ["onError", "onLoad"],
|
|
97
|
-
iframe: ["onError", "onLoad"],
|
|
98
|
-
img: ["onError", "onLoad"]
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
"jsx-a11y/no-noninteractive-element-to-interactive-role": [
|
|
102
|
-
"error",
|
|
103
|
-
{
|
|
104
|
-
fieldset: ["radiogroup", "presentation"],
|
|
105
|
-
li: [
|
|
106
|
-
"menuitem",
|
|
107
|
-
"menuitemradio",
|
|
108
|
-
"menuitemcheckbox",
|
|
109
|
-
"option",
|
|
110
|
-
"row",
|
|
111
|
-
"tab",
|
|
112
|
-
"treeitem"
|
|
113
|
-
],
|
|
114
|
-
ol: [
|
|
115
|
-
"listbox",
|
|
116
|
-
"menu",
|
|
117
|
-
"menubar",
|
|
118
|
-
"radiogroup",
|
|
119
|
-
"tablist",
|
|
120
|
-
"tree",
|
|
121
|
-
"treegrid"
|
|
122
|
-
],
|
|
123
|
-
table: ["grid"],
|
|
124
|
-
td: ["gridcell"],
|
|
125
|
-
ul: [
|
|
126
|
-
"listbox",
|
|
127
|
-
"menu",
|
|
128
|
-
"menubar",
|
|
129
|
-
"radiogroup",
|
|
130
|
-
"tablist",
|
|
131
|
-
"tree",
|
|
132
|
-
"treegrid"
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
],
|
|
136
|
-
"jsx-a11y/no-noninteractive-tabindex": "error",
|
|
137
|
-
"jsx-a11y/no-redundant-roles": "error",
|
|
138
|
-
"jsx-a11y/no-static-element-interactions": "error",
|
|
139
|
-
"jsx-a11y/prefer-tag-over-role": "error",
|
|
140
|
-
"jsx-a11y/role-has-required-aria-props": "error",
|
|
141
|
-
"jsx-a11y/role-supports-aria-props": "error",
|
|
142
|
-
"jsx-a11y/scope": "error",
|
|
143
|
-
"jsx-a11y/tabindex-no-positive": "error"
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export default jsxA11yRules;
|
package/rules/no-unsanitized.js
DELETED
package/rules/redos.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @import { Linter } from "eslint";
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const timeout = 10_000;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @satisfies {Linter.RulesRecord}
|
|
9
|
-
*/
|
|
10
|
-
const redosRules = {
|
|
11
|
-
"redos/no-vulnerable": [
|
|
12
|
-
"error",
|
|
13
|
-
{
|
|
14
|
-
checker: "auto",
|
|
15
|
-
ignoreErrors: true,
|
|
16
|
-
permittableComplexities: [],
|
|
17
|
-
timeout
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default redosRules;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const bugDetectionRules = {
|
|
2
|
-
"sonarjs/no-all-duplicated-branches": "error",
|
|
3
|
-
"sonarjs/no-element-overwrite": "error",
|
|
4
|
-
"sonarjs/no-empty-collection": "error",
|
|
5
|
-
"sonarjs/no-extra-arguments": "error",
|
|
6
|
-
"sonarjs/no-identical-conditions": "error",
|
|
7
|
-
"sonarjs/no-identical-expressions": "error",
|
|
8
|
-
"sonarjs/no-ignored-return": "error",
|
|
9
|
-
"sonarjs/no-use-of-empty-return-value": "error",
|
|
10
|
-
"sonarjs/non-existent-operator": "error"
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default bugDetectionRules;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const maximumCognitiveComplexity = 15;
|
|
2
|
-
const maxSwitchCases = 20;
|
|
3
|
-
const duplicateStringThreshold = 3;
|
|
4
|
-
const identicalFunctionThreshold = 3;
|
|
5
|
-
|
|
6
|
-
const codeSmellDetectionRules = {
|
|
7
|
-
"sonarjs/cognitive-complexity": ["error", maximumCognitiveComplexity],
|
|
8
|
-
"sonarjs/elseif-without-else": "off",
|
|
9
|
-
"sonarjs/max-switch-cases": ["error", maxSwitchCases],
|
|
10
|
-
"sonarjs/no-collapsible-if": "error",
|
|
11
|
-
"sonarjs/no-collection-size-mischeck": "error",
|
|
12
|
-
"sonarjs/no-duplicate-string": [
|
|
13
|
-
"error",
|
|
14
|
-
{
|
|
15
|
-
ignoreStrings: "application/json",
|
|
16
|
-
threshold: duplicateStringThreshold
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"sonarjs/no-duplicated-branches": "error",
|
|
20
|
-
"sonarjs/no-gratuitous-expressions": "error",
|
|
21
|
-
"sonarjs/no-identical-functions": ["error", identicalFunctionThreshold],
|
|
22
|
-
"sonarjs/no-inverted-boolean-check": "error",
|
|
23
|
-
"sonarjs/no-nested-switch": "off",
|
|
24
|
-
"sonarjs/no-nested-template-literals": "error",
|
|
25
|
-
"sonarjs/no-redundant-boolean": "error",
|
|
26
|
-
"sonarjs/no-redundant-jump": "error",
|
|
27
|
-
"sonarjs/no-same-line-conditional": "error",
|
|
28
|
-
"sonarjs/no-small-switch": "error",
|
|
29
|
-
"sonarjs/no-unused-collection": "error",
|
|
30
|
-
"sonarjs/no-useless-catch": "error",
|
|
31
|
-
"sonarjs/prefer-immediate-return": "error",
|
|
32
|
-
"sonarjs/prefer-object-literal": "error",
|
|
33
|
-
"sonarjs/prefer-single-boolean-return": "error",
|
|
34
|
-
"sonarjs/prefer-while": "error"
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default codeSmellDetectionRules;
|