@pumpn/eslint-config 15.1.5 → 15.2.1
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 +10 -3
- package/deno.json +14 -16
- package/deno.lock +1779 -278
- package/package.json +17 -17
- package/plugins.js +1 -0
- package/rules/import-x/helpful-warnings.js +1 -0
- package/rules/perfectionist.js +20 -133
- package/rules/react/_exports.js +1 -0
- package/rules/react/core.js +2 -1
- package/rules/react/hooks-extra.js +0 -1
- package/rules/react/naming-convention.js +3 -0
- package/rules/react/web-api.js +8 -0
- package/rules/stylistic/brackets.js +10 -2
- package/rules/stylistic/indent.js +4 -1
- package/rules/stylistic/jsx.js +1 -1
- package/rules/unicorn.js +3 -1
- package/scripts/update-import-map.js +1 -1
- package/tsconfig.json +2 -1
- package/import-map.json +0 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pumpn/eslint-config",
|
|
3
|
-
"version": "15.1
|
|
3
|
+
"version": "15.2.1",
|
|
4
4
|
"description": "standard eslint config for pumpn code projects",
|
|
5
5
|
"main": "config.js",
|
|
6
6
|
"author": "Nano Miratus <nanomiratus@gmail.com>",
|
|
@@ -17,35 +17,35 @@
|
|
|
17
17
|
"test": "echo 'no tests yet'"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"eslint": "^9.
|
|
20
|
+
"eslint": "^9.13.0"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
24
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
25
|
-
"@stylistic/eslint-plugin": "^2.
|
|
26
|
-
"@typescript-eslint/parser": "^8.0
|
|
27
|
-
"eslint-plugin-depend": "^0.
|
|
23
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
24
|
+
"@eslint-react/eslint-plugin": "^1.15.0",
|
|
25
|
+
"@stylistic/eslint-plugin": "^2.9.0",
|
|
26
|
+
"@typescript-eslint/parser": "^8.11.0",
|
|
27
|
+
"eslint-plugin-depend": "^0.11.0",
|
|
28
28
|
"eslint-plugin-disable-autofix": "^5.0.1",
|
|
29
29
|
"eslint-plugin-func-params-args": "^4.0.0",
|
|
30
|
-
"eslint-plugin-import-x": "^3.1
|
|
31
|
-
"eslint-plugin-jsdoc": "^50.
|
|
30
|
+
"eslint-plugin-import-x": "^4.3.1",
|
|
31
|
+
"eslint-plugin-jsdoc": "^50.4.3",
|
|
32
32
|
"eslint-plugin-no-secrets": "^1.0.2",
|
|
33
|
-
"eslint-plugin-perfectionist": "^3.1
|
|
33
|
+
"eslint-plugin-perfectionist": "^3.9.1",
|
|
34
34
|
"eslint-plugin-promise": "^7.1.0",
|
|
35
35
|
"eslint-plugin-redos": "^4.4.5",
|
|
36
36
|
"eslint-plugin-regexp": "^2.6.0",
|
|
37
37
|
"eslint-plugin-security": "^3.0.1",
|
|
38
|
-
"eslint-plugin-sonarjs": "^
|
|
39
|
-
"eslint-plugin-tailwindcss": "^3.17.
|
|
40
|
-
"eslint-plugin-unicorn": "^
|
|
41
|
-
"globals": "^15.
|
|
38
|
+
"eslint-plugin-sonarjs": "^2.0.4",
|
|
39
|
+
"eslint-plugin-tailwindcss": "^3.17.5",
|
|
40
|
+
"eslint-plugin-unicorn": "^56.0.0",
|
|
41
|
+
"globals": "^15.11.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"eslint": "^9.9.0"
|
|
45
45
|
},
|
|
46
46
|
"overrides": {
|
|
47
|
-
"@typescript-eslint/type-utils": "^8.
|
|
48
|
-
"@typescript-eslint/utils": "^8.
|
|
49
|
-
"eslint": "^9.
|
|
47
|
+
"@typescript-eslint/type-utils": "^8.11.0",
|
|
48
|
+
"@typescript-eslint/utils": "^8.11.0",
|
|
49
|
+
"eslint": "^9.13.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/plugins.js
CHANGED
package/rules/perfectionist.js
CHANGED
|
@@ -2,18 +2,7 @@ const perfectionistRules = {
|
|
|
2
2
|
"perfectionist/sort-array-includes": [
|
|
3
3
|
"error",
|
|
4
4
|
{
|
|
5
|
-
groupKind: "literals-first"
|
|
6
|
-
ignoreCase: false,
|
|
7
|
-
order: "asc",
|
|
8
|
-
type: "natural"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"perfectionist/sort-astro-attributes": [
|
|
12
|
-
"error",
|
|
13
|
-
{
|
|
14
|
-
ignoreCase: false,
|
|
15
|
-
order: "asc",
|
|
16
|
-
type: "natural"
|
|
5
|
+
groupKind: "literals-first"
|
|
17
6
|
}
|
|
18
7
|
],
|
|
19
8
|
"perfectionist/sort-classes": [
|
|
@@ -26,32 +15,18 @@ const perfectionistRules = {
|
|
|
26
15
|
"property",
|
|
27
16
|
"constructor",
|
|
28
17
|
"static-method",
|
|
18
|
+
"static-function-property",
|
|
29
19
|
"private-method",
|
|
20
|
+
"private-function-property",
|
|
30
21
|
"method",
|
|
22
|
+
"function-property",
|
|
31
23
|
["get-method", "set-method"],
|
|
32
24
|
"unknown"
|
|
33
|
-
]
|
|
34
|
-
ignoreCase: false,
|
|
35
|
-
order: "asc",
|
|
36
|
-
type: "natural"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
"perfectionist/sort-enums": [
|
|
40
|
-
"error",
|
|
41
|
-
{
|
|
42
|
-
ignoreCase: false,
|
|
43
|
-
order: "asc",
|
|
44
|
-
type: "natural"
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"perfectionist/sort-exports": [
|
|
48
|
-
"error",
|
|
49
|
-
{
|
|
50
|
-
ignoreCase: false,
|
|
51
|
-
order: "asc",
|
|
52
|
-
type: "natural"
|
|
25
|
+
]
|
|
53
26
|
}
|
|
54
27
|
],
|
|
28
|
+
"perfectionist/sort-enums": ["error"],
|
|
29
|
+
"perfectionist/sort-exports": ["error"],
|
|
55
30
|
"perfectionist/sort-imports": [
|
|
56
31
|
"error",
|
|
57
32
|
{
|
|
@@ -87,29 +62,13 @@ const perfectionistRules = {
|
|
|
87
62
|
"index",
|
|
88
63
|
"unknown"
|
|
89
64
|
],
|
|
90
|
-
ignoreCase: false,
|
|
91
65
|
internalPattern: ["@/**"],
|
|
92
66
|
newlinesBetween: "always",
|
|
93
|
-
|
|
94
|
-
type: "natural"
|
|
95
|
-
}
|
|
96
|
-
],
|
|
97
|
-
"perfectionist/sort-interfaces": [
|
|
98
|
-
"error",
|
|
99
|
-
{
|
|
100
|
-
ignoreCase: false,
|
|
101
|
-
order: "asc",
|
|
102
|
-
type: "natural"
|
|
103
|
-
}
|
|
104
|
-
],
|
|
105
|
-
"perfectionist/sort-intersection-types": [
|
|
106
|
-
"error",
|
|
107
|
-
{
|
|
108
|
-
ignoreCase: false,
|
|
109
|
-
order: "asc",
|
|
110
|
-
type: "natural"
|
|
67
|
+
sortSideEffects: true
|
|
111
68
|
}
|
|
112
69
|
],
|
|
70
|
+
"perfectionist/sort-interfaces": ["error"],
|
|
71
|
+
"perfectionist/sort-intersection-types": ["error"],
|
|
113
72
|
"perfectionist/sort-jsx-props": [
|
|
114
73
|
"error",
|
|
115
74
|
{
|
|
@@ -117,44 +76,13 @@ const perfectionistRules = {
|
|
|
117
76
|
"shorthand",
|
|
118
77
|
"unknown",
|
|
119
78
|
"multiline"
|
|
120
|
-
]
|
|
121
|
-
ignoreCase: false,
|
|
122
|
-
order: "asc",
|
|
123
|
-
type: "natural"
|
|
124
|
-
}
|
|
125
|
-
],
|
|
126
|
-
"perfectionist/sort-maps": [
|
|
127
|
-
"error",
|
|
128
|
-
{
|
|
129
|
-
ignoreCase: false,
|
|
130
|
-
order: "asc",
|
|
131
|
-
type: "natural"
|
|
132
|
-
}
|
|
133
|
-
],
|
|
134
|
-
"perfectionist/sort-named-exports": [
|
|
135
|
-
"error",
|
|
136
|
-
{
|
|
137
|
-
ignoreCase: false,
|
|
138
|
-
order: "asc",
|
|
139
|
-
type: "natural"
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
"perfectionist/sort-named-imports": [
|
|
143
|
-
"error",
|
|
144
|
-
{
|
|
145
|
-
ignoreCase: false,
|
|
146
|
-
order: "asc",
|
|
147
|
-
type: "natural"
|
|
148
|
-
}
|
|
149
|
-
],
|
|
150
|
-
"perfectionist/sort-object-types": [
|
|
151
|
-
"error",
|
|
152
|
-
{
|
|
153
|
-
ignoreCase: false,
|
|
154
|
-
order: "asc",
|
|
155
|
-
type: "natural"
|
|
79
|
+
]
|
|
156
80
|
}
|
|
157
81
|
],
|
|
82
|
+
"perfectionist/sort-maps": ["error"],
|
|
83
|
+
"perfectionist/sort-named-exports": ["error"],
|
|
84
|
+
"perfectionist/sort-named-imports": ["error"],
|
|
85
|
+
"perfectionist/sort-object-types": ["error"],
|
|
158
86
|
"perfectionist/sort-objects": [
|
|
159
87
|
"error",
|
|
160
88
|
{
|
|
@@ -238,54 +166,13 @@ const perfectionistRules = {
|
|
|
238
166
|
"groupColor2",
|
|
239
167
|
"groupColor3",
|
|
240
168
|
"unknown"
|
|
241
|
-
]
|
|
242
|
-
ignoreCase: false,
|
|
243
|
-
order: "asc",
|
|
244
|
-
partitionByComment: true,
|
|
245
|
-
partitionByNewLine: true,
|
|
246
|
-
type: "natural"
|
|
169
|
+
]
|
|
247
170
|
}
|
|
248
171
|
],
|
|
249
|
-
"perfectionist/sort-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
order: "asc",
|
|
254
|
-
type: "natural"
|
|
255
|
-
}
|
|
256
|
-
],
|
|
257
|
-
"perfectionist/sort-switch-case": [
|
|
258
|
-
"error",
|
|
259
|
-
{
|
|
260
|
-
ignoreCase: false,
|
|
261
|
-
order: "asc",
|
|
262
|
-
type: "natural"
|
|
263
|
-
}
|
|
264
|
-
],
|
|
265
|
-
"perfectionist/sort-union-types": [
|
|
266
|
-
"error",
|
|
267
|
-
{
|
|
268
|
-
ignoreCase: false,
|
|
269
|
-
order: "asc",
|
|
270
|
-
type: "natural"
|
|
271
|
-
}
|
|
272
|
-
],
|
|
273
|
-
"perfectionist/sort-variable-declarations": [
|
|
274
|
-
"error",
|
|
275
|
-
{
|
|
276
|
-
ignoreCase: false,
|
|
277
|
-
order: "asc",
|
|
278
|
-
type: "natural"
|
|
279
|
-
}
|
|
280
|
-
],
|
|
281
|
-
"perfectionist/sort-vue-attributes": [
|
|
282
|
-
"error",
|
|
283
|
-
{
|
|
284
|
-
ignoreCase: false,
|
|
285
|
-
order: "asc",
|
|
286
|
-
type: "natural"
|
|
287
|
-
}
|
|
288
|
-
]
|
|
172
|
+
"perfectionist/sort-sets": ["error"],
|
|
173
|
+
"perfectionist/sort-switch-case": ["error"],
|
|
174
|
+
"perfectionist/sort-union-types": ["error"],
|
|
175
|
+
"perfectionist/sort-variable-declarations": ["error"]
|
|
289
176
|
};
|
|
290
177
|
|
|
291
178
|
export default perfectionistRules;
|
package/rules/react/_exports.js
CHANGED
|
@@ -3,3 +3,4 @@ export { default as debugRules } from "./debug.js";
|
|
|
3
3
|
export { default as domRules } from "./dom.js";
|
|
4
4
|
export { default as hooksExtraRules } from "./hooks-extra.js";
|
|
5
5
|
export { default as namingConventionRules } from "./naming-convention.js";
|
|
6
|
+
export { default as webApiRules } from "./web-api.js";
|
package/rules/react/core.js
CHANGED
|
@@ -39,8 +39,9 @@ const coreRules = {
|
|
|
39
39
|
"@eslint-react/no-unstable-default-props": "error",
|
|
40
40
|
"@eslint-react/no-unused-class-component-members": "error",
|
|
41
41
|
"@eslint-react/no-unused-state": "error",
|
|
42
|
-
"@eslint-react/no-useless-fragment": "error",
|
|
42
|
+
"@eslint-react/no-useless-fragment": ["error", { allowExpressions: true }],
|
|
43
43
|
"@eslint-react/prefer-destructuring-assignment": "error",
|
|
44
|
+
"@eslint-react/prefer-react-namespace-import": "error",
|
|
44
45
|
"@eslint-react/prefer-read-only-props": "error",
|
|
45
46
|
"@eslint-react/prefer-shorthand-boolean": "error",
|
|
46
47
|
"@eslint-react/prefer-shorthand-fragment": "error"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const hooksExtraRules = {
|
|
2
2
|
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "error",
|
|
3
|
-
"@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect": "error",
|
|
4
3
|
"@eslint-react/hooks-extra/no-redundant-custom-hook": "error",
|
|
5
4
|
"@eslint-react/hooks-extra/no-unnecessary-use-callback": "error",
|
|
6
5
|
"@eslint-react/hooks-extra/no-unnecessary-use-memo": "error",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const namingConventionRules = {
|
|
2
|
+
"@eslint-react/web-api/no-leaked-event-listener": ["error"],
|
|
3
|
+
"@eslint-react/web-api/no-leaked-interval": ["error"],
|
|
4
|
+
"@eslint-react/web-api/no-leaked-resize-observer": ["error"],
|
|
5
|
+
"@eslint-react/web-api/no-leaked-timeout": ["error"]
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default namingConventionRules;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { minItemsForArrayNewline } from "./_common/_exports.js";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const minElementsForCurlyNewline = 3;
|
|
4
4
|
const wrapMultilinesDefault = "parens-new-line";
|
|
5
5
|
|
|
6
6
|
const bracketsRules = {
|
|
@@ -14,6 +14,14 @@ const bracketsRules = {
|
|
|
14
14
|
"@stylistic/array-bracket-spacing": ["error", "never"],
|
|
15
15
|
"@stylistic/arrow-parens": ["error", "always"],
|
|
16
16
|
"@stylistic/brace-style": ["error", "stroustrup"],
|
|
17
|
+
"@stylistic/curly-newline": [
|
|
18
|
+
"error",
|
|
19
|
+
{
|
|
20
|
+
minElements: minElementsForCurlyNewline,
|
|
21
|
+
consistent: true,
|
|
22
|
+
multiline: true
|
|
23
|
+
}
|
|
24
|
+
],
|
|
17
25
|
"@stylistic/function-paren-newline": ["error", "multiline-arguments"],
|
|
18
26
|
"@stylistic/jsx-closing-bracket-location": "error",
|
|
19
27
|
"@stylistic/jsx-curly-brace-presence": [
|
|
@@ -56,7 +64,7 @@ const bracketsRules = {
|
|
|
56
64
|
"@stylistic/object-curly-newline": [
|
|
57
65
|
"error",
|
|
58
66
|
{
|
|
59
|
-
minProperties:
|
|
67
|
+
minProperties: minElementsForCurlyNewline,
|
|
60
68
|
consistent: true,
|
|
61
69
|
multiline: true
|
|
62
70
|
}
|
package/rules/stylistic/jsx.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const jsxRules = {
|
|
2
2
|
"@stylistic/jsx-child-element-spacing": "error",
|
|
3
|
-
"@stylistic/jsx-closing-tag-location": "error",
|
|
3
|
+
"@stylistic/jsx-closing-tag-location": ["error", "line-aligned"],
|
|
4
4
|
"@stylistic/jsx-equals-spacing": ["error", "never"],
|
|
5
5
|
"@stylistic/jsx-max-props-per-line": [
|
|
6
6
|
"error",
|
package/rules/unicorn.js
CHANGED
|
@@ -31,10 +31,10 @@ const patterns = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const unicornRules = {
|
|
34
|
-
"unicorn/better-regex": "error",
|
|
35
34
|
"unicorn/catch-error-name": "error",
|
|
36
35
|
"unicorn/consistent-destructuring": "error",
|
|
37
36
|
"unicorn/consistent-empty-array-spread": "error",
|
|
37
|
+
"unicorn/consistent-existence-index-check": "error",
|
|
38
38
|
"unicorn/consistent-function-scoping": "error",
|
|
39
39
|
"unicorn/custom-error-definition": "error",
|
|
40
40
|
"unicorn/empty-brace-spaces": "error",
|
|
@@ -142,10 +142,12 @@ const unicornRules = {
|
|
|
142
142
|
"unicorn/prefer-dom-node-text-content": "error",
|
|
143
143
|
"unicorn/prefer-event-target": "error",
|
|
144
144
|
"unicorn/prefer-export-from": "error",
|
|
145
|
+
"unicorn/prefer-global-this": "error",
|
|
145
146
|
"unicorn/prefer-includes": "error",
|
|
146
147
|
"unicorn/prefer-json-parse-buffer": "off",
|
|
147
148
|
"unicorn/prefer-keyboard-event-key": "error",
|
|
148
149
|
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
150
|
+
"unicorn/prefer-math-min-max": "error",
|
|
149
151
|
"unicorn/prefer-math-trunc": "error",
|
|
150
152
|
"unicorn/prefer-modern-dom-apis": "error",
|
|
151
153
|
"unicorn/prefer-modern-math-apis": "error",
|
|
@@ -10,7 +10,7 @@ const packageJsonFilePath = join(cwd(), "package.json");
|
|
|
10
10
|
const packageJsonFileContent = await readTextFile(packageJsonFilePath);
|
|
11
11
|
const packageJson = JSON.parse(packageJsonFileContent);
|
|
12
12
|
|
|
13
|
-
const importMapFilePath = join(cwd(), "
|
|
13
|
+
const importMapFilePath = join(cwd(), "deno.json");
|
|
14
14
|
const importMapFileContent = await readTextFile(importMapFilePath);
|
|
15
15
|
const importMap = JSON.parse(importMapFileContent);
|
|
16
16
|
|
package/tsconfig.json
CHANGED
package/import-map.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"imports": {
|
|
3
|
-
"@eslint-community/eslint-plugin-eslint-comments": "npm:@eslint-community/eslint-plugin-eslint-comments@^4.3.0",
|
|
4
|
-
"@eslint-react/eslint-plugin": "npm:@eslint-react/eslint-plugin@^1.9.1",
|
|
5
|
-
"@std/path": "jsr:@std/path@^1",
|
|
6
|
-
"@stylistic/eslint-plugin": "npm:@stylistic/eslint-plugin@^2.6.2",
|
|
7
|
-
"@typescript-eslint/parser": "npm:@typescript-eslint/parser@^8.0.1",
|
|
8
|
-
"eslint-plugin-depend": "npm:eslint-plugin-depend@^0.9.0",
|
|
9
|
-
"eslint-plugin-disable-autofix": "npm:eslint-plugin-disable-autofix@^5.0.1",
|
|
10
|
-
"eslint-plugin-func-params-args": "npm:eslint-plugin-func-params-args@^4.0.0",
|
|
11
|
-
"eslint-plugin-import-x": "npm:eslint-plugin-import-x@^3.1.0",
|
|
12
|
-
"eslint-plugin-jsdoc": "npm:eslint-plugin-jsdoc@^50.0.0",
|
|
13
|
-
"eslint-plugin-no-secrets": "npm:eslint-plugin-no-secrets@^1.0.2",
|
|
14
|
-
"eslint-plugin-perfectionist": "npm:eslint-plugin-perfectionist@^3.1.3",
|
|
15
|
-
"eslint-plugin-promise": "npm:eslint-plugin-promise@^7.1.0",
|
|
16
|
-
"eslint-plugin-react": "npm:eslint-plugin-react@^7.35.0",
|
|
17
|
-
"eslint-plugin-redos": "npm:eslint-plugin-redos@^4.4.5",
|
|
18
|
-
"eslint-plugin-regexp": "npm:eslint-plugin-regexp@^2.6.0",
|
|
19
|
-
"eslint-plugin-security": "npm:eslint-plugin-security@^3.0.1",
|
|
20
|
-
"eslint-plugin-sonarjs": "npm:eslint-plugin-sonarjs@^1.0.4",
|
|
21
|
-
"eslint-plugin-tailwindcss": "npm:eslint-plugin-tailwindcss@^3.17.4",
|
|
22
|
-
"eslint-plugin-unicorn": "npm:eslint-plugin-unicorn@^55.0.0",
|
|
23
|
-
"globals": "npm:globals@^15.9.0",
|
|
24
|
-
"preact": "https://esm.sh/*preact@10.19.3?dev",
|
|
25
|
-
"preact/jsx-runtime": "https://esm.sh/*preact@10.19.3/jsx-runtime?dev"
|
|
26
|
-
}
|
|
27
|
-
}
|