@pumpn/eslint-config 16.2.1 → 17.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.
@@ -0,0 +1,135 @@
1
+ const suggestionRules = {
2
+ "sonarjs/argument-type": "error",
3
+ "sonarjs/arguments-order": "error",
4
+ "sonarjs/arguments-usage": "error",
5
+ "sonarjs/array-constructor": "error",
6
+ "sonarjs/arrow-function-convention": "off",
7
+ "sonarjs/assertions-in-tests": "error",
8
+ "sonarjs/block-scoped-var": "error",
9
+ "sonarjs/bool-param-default": "error",
10
+ "sonarjs/call-argument-line": "error",
11
+ "sonarjs/chai-determinate-assertion": "error",
12
+ "sonarjs/class-name": "error",
13
+ "sonarjs/class-prototype": "error",
14
+ "sonarjs/cognitive-complexity": "error",
15
+ "sonarjs/comment-regex": "error",
16
+ "sonarjs/concise-regex": "error",
17
+ "sonarjs/cyclomatic-complexity": "error",
18
+ "sonarjs/declarations-in-global-scope": "error",
19
+ "sonarjs/deprecation": "error",
20
+ "sonarjs/destructuring-assignment-syntax": "error",
21
+ "sonarjs/duplicates-in-character-class": "error",
22
+ "sonarjs/elseif-without-else": "error",
23
+ "sonarjs/expression-complexity": "error",
24
+ "sonarjs/file-header": "off",
25
+ "sonarjs/file-name-differ-from-class": "off",
26
+ "sonarjs/fixme-tag": "error",
27
+ "sonarjs/function-inside-loop": "error",
28
+ "sonarjs/function-name": "error",
29
+ "sonarjs/function-return-type": "error",
30
+ "sonarjs/future-reserved-words": "error",
31
+ "sonarjs/inconsistent-function-call": "error",
32
+ "sonarjs/index-of-compare-to-positive-number": "error",
33
+ "sonarjs/inverted-assertion-arguments": "error",
34
+ "sonarjs/label-position": "error",
35
+ "sonarjs/max-lines": "error",
36
+ "sonarjs/max-lines-per-function": "error",
37
+ "sonarjs/max-switch-cases": "error",
38
+ "sonarjs/max-union-size": "error",
39
+ "sonarjs/misplaced-loop-counter": "error",
40
+ "sonarjs/nested-control-flow": "error",
41
+ "sonarjs/no-array-delete": "error",
42
+ "sonarjs/no-associative-arrays": "error",
43
+ "sonarjs/no-async-constructor": "error",
44
+ "sonarjs/no-case-label-in-switch": "error",
45
+ "sonarjs/no-code-after-done": "error",
46
+ "sonarjs/no-collapsible-if": "error",
47
+ "sonarjs/no-commented-code": "error",
48
+ "sonarjs/no-dead-store": "error",
49
+ "sonarjs/no-duplicate-in-composite": "error",
50
+ "sonarjs/no-duplicate-string": "error",
51
+ "sonarjs/no-duplicated-branches": "error",
52
+ "sonarjs/no-empty-after-reluctant": "error",
53
+ "sonarjs/no-empty-group": "error",
54
+ "sonarjs/no-empty-test-file": "error",
55
+ "sonarjs/no-equals-in-for-termination": "error",
56
+ "sonarjs/no-fallthrough": "error",
57
+ "sonarjs/no-for-in-iterable": "error",
58
+ "sonarjs/no-global-this": "error",
59
+ "sonarjs/no-gratuitous-expressions": "error",
60
+ "sonarjs/no-identical-functions": "error",
61
+ "sonarjs/no-ignored-exceptions": "error",
62
+ "sonarjs/no-implicit-dependencies": "off",
63
+ "sonarjs/no-implicit-global": "error",
64
+ "sonarjs/no-in-misuse": "error",
65
+ "sonarjs/no-incomplete-assertions": "error",
66
+ "sonarjs/no-inconsistent-returns": "error",
67
+ "sonarjs/no-incorrect-string-concat": "error",
68
+ "sonarjs/no-internal-api-use": "error",
69
+ "sonarjs/no-invariant-returns": "error",
70
+ "sonarjs/no-inverted-boolean-check": "error",
71
+ "sonarjs/no-labels": "error",
72
+ "sonarjs/no-misleading-array-reverse": "error",
73
+ "sonarjs/no-nested-assignment": "error",
74
+ "sonarjs/no-nested-conditional": "error",
75
+ "sonarjs/no-nested-functions": "error",
76
+ "sonarjs/no-nested-incdec": "error",
77
+ "sonarjs/no-nested-switch": "error",
78
+ "sonarjs/no-nested-template-literals": "error",
79
+ "sonarjs/no-primitive-wrappers": "error",
80
+ "sonarjs/no-redundant-assignments": "error",
81
+ "sonarjs/no-redundant-boolean": "error",
82
+ "sonarjs/no-redundant-jump": "error",
83
+ "sonarjs/no-redundant-optional": "error",
84
+ "sonarjs/no-regex-spaces": "error",
85
+ "sonarjs/no-require-or-define": "error",
86
+ "sonarjs/no-return-type-any": "error",
87
+ "sonarjs/no-same-line-conditional": "error",
88
+ "sonarjs/no-selector-parameter": "error",
89
+ "sonarjs/no-skipped-tests": "error",
90
+ "sonarjs/no-small-switch": "error",
91
+ "sonarjs/no-sonar-comments": "error",
92
+ "sonarjs/no-table-as-layout": "error",
93
+ "sonarjs/no-undefined-argument": "error",
94
+ "sonarjs/no-undefined-assignment": "off",
95
+ "sonarjs/no-unenclosed-multiline-block": "error",
96
+ "sonarjs/no-uniq-key": "error",
97
+ "sonarjs/no-unused-collection": "error",
98
+ "sonarjs/no-unused-function-argument": "error",
99
+ "sonarjs/no-unused-vars": "error",
100
+ "sonarjs/no-useless-catch": "error",
101
+ "sonarjs/no-variable-usage-before-declaration": "error",
102
+ "sonarjs/no-wildcard-import": "off",
103
+ "sonarjs/non-number-in-arithmetic-expression": "error",
104
+ "sonarjs/object-alt-content": "error",
105
+ "sonarjs/operation-returning-nan": "error",
106
+ "sonarjs/prefer-default-last": "error",
107
+ "sonarjs/prefer-immediate-return": "error",
108
+ "sonarjs/prefer-object-literal": "error",
109
+ "sonarjs/prefer-promise-shorthand": "error",
110
+ "sonarjs/prefer-read-only-props": "error",
111
+ "sonarjs/prefer-regexp-exec": "error",
112
+ "sonarjs/prefer-single-boolean-return": "error",
113
+ "sonarjs/prefer-type-guard": "error",
114
+ "sonarjs/prefer-while": "error",
115
+ "sonarjs/public-static-readonly": "error",
116
+ "sonarjs/redundant-type-aliases": "error",
117
+ "sonarjs/regex-complexity": "error",
118
+ "sonarjs/shorthand-property-grouping": "off",
119
+ "sonarjs/single-char-in-character-classes": "error",
120
+ "sonarjs/single-character-alternation": "error",
121
+ "sonarjs/stable-tests": "error",
122
+ "sonarjs/strings-comparison": "error",
123
+ "sonarjs/test-check-exception": "error",
124
+ "sonarjs/todo-tag": "off",
125
+ "sonarjs/too-many-break-or-continue-in-loop": "error",
126
+ "sonarjs/unused-import": "error",
127
+ "sonarjs/unused-named-groups": "error",
128
+ "sonarjs/updated-loop-counter": "error",
129
+ "sonarjs/use-type-alias": "error",
130
+ "sonarjs/values-not-convertible-to-numbers": "error",
131
+ "sonarjs/variable-name": "error",
132
+ "sonarjs/void-use": "error"
133
+ };
134
+
135
+ export default suggestionRules;
@@ -1,4 +1,15 @@
1
1
  const jsxRules = {
2
+ "@stylistic/exp-jsx-props-style": [
3
+ "error",
4
+ {
5
+ multiLine: {
6
+ minItems: 0
7
+ },
8
+ singleLine: {
9
+ maxItems: 3
10
+ }
11
+ }
12
+ ],
2
13
  "@stylistic/jsx-child-element-spacing": "error",
3
14
  "@stylistic/jsx-closing-tag-location": ["error", "line-aligned"],
4
15
  "@stylistic/jsx-equals-spacing": ["error", "never"],
@@ -8,6 +8,21 @@ const spacingRules = {
8
8
  ],
9
9
  "@stylistic/block-spacing": ["error", "always"],
10
10
  "@stylistic/computed-property-spacing": ["error", "never"],
11
+ "@stylistic/exp-list-style": [
12
+ "error",
13
+ {
14
+ multiLine: {
15
+ minItems: 0
16
+ },
17
+ overrides: {
18
+ "{}": { singleLine: { spacing: "always" } }
19
+ },
20
+ singleLine: {
21
+ maxItems: 3,
22
+ spacing: "never"
23
+ }
24
+ }
25
+ ],
11
26
  "@stylistic/function-call-spacing": ["error", "never"],
12
27
  "@stylistic/generator-star-spacing": ["error", "after"],
13
28
  "@stylistic/key-spacing": [
@@ -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": "error",
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;
@@ -1,13 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint";
3
- */
4
-
5
- /**
6
- * @satisfies {Linter.RulesRecord}
7
- */
8
- const noUnsanitizedRules = {
9
- "no-unsanitized/method": "error",
10
- "no-unsanitized/property": "error"
11
- };
12
-
13
- export default noUnsanitizedRules;
@@ -1,5 +0,0 @@
1
- const hooksExtraRules = {
2
- "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "error"
3
- };
4
-
5
- export default hooksExtraRules;
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;