@pumpn/eslint-config 15.6.1 → 16.1.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/.vscode/settings.json +14 -1
- package/config.js +27 -91
- package/deno.json +22 -22
- package/deno.lock +698 -2293
- package/eslint.config.js +13 -5
- package/package.json +20 -21
- package/plugins.js +15 -13
- package/rules/_exports.js +1 -1
- package/rules/command.js +12 -0
- package/rules/depend.js +1 -1
- package/rules/eslint-comments.js +1 -1
- package/rules/github.js +1 -1
- package/rules/import-x/helpful-warnings.js +2 -2
- package/rules/import-x/static-analysis.js +1 -1
- package/rules/import-x/style-guide.js +11 -8
- package/rules/import-x.js +1 -1
- package/rules/jsdoc.js +3 -27
- package/rules/jsx-a11y.js +1 -1
- package/rules/layout-and-formatting.js +1 -1
- package/rules/no-secrets.js +1 -1
- package/rules/no-unsanitized.js +1 -1
- package/rules/perfectionist.js +21 -24
- package/rules/possible-problems.js +1 -1
- package/rules/promise.js +20 -5
- package/rules/react.js +1 -1
- package/rules/redos.js +1 -1
- package/rules/regexp.js +1 -1
- package/rules/security.js +1 -1
- package/rules/sonarjs.js +1 -1
- package/rules/stylistic/_common/min-items-for-array-newline.js +1 -1
- package/rules/stylistic/indent.js +0 -1
- package/rules/stylistic/linebreaks.js +3 -15
- package/rules/stylistic.js +1 -1
- package/rules/suggestions.js +4 -16
- package/rules/tailwindcss.js +1 -1
- package/rules/unicorn.js +24 -6
- package/rules.js +1 -1
- package/scripts/update-package-json.js +42 -22
- package/.tool-versions +0 -1
- package/documentation/global.html +0 -566
- package/documentation/index.html +0 -135
- package/documentation/index.js.html +0 -35865
- package/documentation/scripts/app.min.js +0 -1
- package/documentation/scripts/linenumber.js +0 -26
- package/documentation/scripts/search.js +0 -39
- package/documentation/styles/app.min.css +0 -1
- package/documentation/styles/iframe.css +0 -13
- package/documentation/styles/prettify-jsdoc.css +0 -111
- package/documentation/styles/prettify-tomorrow.css +0 -132
- package/documentation/styles/reset.css +0 -44
- package/jsdoc.json +0 -51
- package/rules/func-params-args.js +0 -19
package/rules/suggestions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { Linter } from "eslint"
|
|
2
|
+
* @import { Linter } from "eslint";
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
const minIdentifierLength = 2;
|
|
@@ -53,11 +53,7 @@ const suggestionsRules = {
|
|
|
53
53
|
"dot-notation": "error",
|
|
54
54
|
eqeqeq: "error",
|
|
55
55
|
"func-name-matching": "error",
|
|
56
|
-
"func-names": [
|
|
57
|
-
"error",
|
|
58
|
-
"as-needed",
|
|
59
|
-
{ generators: "as-needed" }
|
|
60
|
-
],
|
|
56
|
+
"func-names": ["error", "as-needed", { generators: "as-needed" }],
|
|
61
57
|
"func-style": "error",
|
|
62
58
|
"grouped-accessor-pairs": "error",
|
|
63
59
|
"guard-for-in": "off",
|
|
@@ -67,11 +63,7 @@ const suggestionsRules = {
|
|
|
67
63
|
{
|
|
68
64
|
min: minIdentifierLength,
|
|
69
65
|
max: maxIdentifierLength,
|
|
70
|
-
exceptions: [
|
|
71
|
-
"x",
|
|
72
|
-
"y",
|
|
73
|
-
"z"
|
|
74
|
-
],
|
|
66
|
+
exceptions: ["x", "y", "z"],
|
|
75
67
|
properties: "never"
|
|
76
68
|
}
|
|
77
69
|
],
|
|
@@ -88,11 +80,7 @@ const suggestionsRules = {
|
|
|
88
80
|
"no-console": [
|
|
89
81
|
"error",
|
|
90
82
|
{
|
|
91
|
-
allow: [
|
|
92
|
-
"warn",
|
|
93
|
-
"error",
|
|
94
|
-
"info"
|
|
95
|
-
]
|
|
83
|
+
allow: ["warn", "error", "info"]
|
|
96
84
|
}
|
|
97
85
|
],
|
|
98
86
|
"no-continue": "off",
|
package/rules/tailwindcss.js
CHANGED
package/rules/unicorn.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { Linter } from "eslint"
|
|
2
|
+
* @import { Linter } from "eslint";
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
const hexadecimalGroupLength = 2;
|
|
@@ -39,6 +39,8 @@ const patterns = {
|
|
|
39
39
|
*/
|
|
40
40
|
const unicornRules = {
|
|
41
41
|
"unicorn/catch-error-name": "error",
|
|
42
|
+
"unicorn/consistent-assert": "error",
|
|
43
|
+
"unicorn/consistent-date-clone": "error",
|
|
42
44
|
"unicorn/consistent-destructuring": "error",
|
|
43
45
|
"unicorn/consistent-empty-array-spread": "error",
|
|
44
46
|
"unicorn/consistent-existence-index-check": "error",
|
|
@@ -46,11 +48,12 @@ const unicornRules = {
|
|
|
46
48
|
"unicorn/custom-error-definition": "error",
|
|
47
49
|
"unicorn/empty-brace-spaces": "error",
|
|
48
50
|
"unicorn/error-message": "error",
|
|
49
|
-
"unicorn/escape-case": "error",
|
|
51
|
+
"unicorn/escape-case": ["error", "uppercase"],
|
|
50
52
|
"unicorn/expiring-todo-comments": [
|
|
51
53
|
"error",
|
|
52
54
|
{
|
|
53
|
-
allowWarningComments: false
|
|
55
|
+
allowWarningComments: false,
|
|
56
|
+
terms: ["todo", "fixme"]
|
|
54
57
|
}
|
|
55
58
|
],
|
|
56
59
|
"unicorn/explicit-length-check": "error",
|
|
@@ -58,12 +61,13 @@ const unicornRules = {
|
|
|
58
61
|
"unicorn/import-style": "error",
|
|
59
62
|
"unicorn/new-for-builtins": "error",
|
|
60
63
|
"unicorn/no-abusive-eslint-disable": "error",
|
|
64
|
+
"unicorn/no-accessor-recursion": "error",
|
|
61
65
|
"unicorn/no-anonymous-default-export": "error",
|
|
62
66
|
"unicorn/no-array-callback-reference": "off",
|
|
63
67
|
"unicorn/no-array-for-each": "error",
|
|
64
68
|
"unicorn/no-array-method-this-argument": "error",
|
|
65
|
-
"unicorn/no-array-push-push": "error",
|
|
66
69
|
"unicorn/no-array-reduce": "off",
|
|
70
|
+
"unicorn/no-array-reverse": "error",
|
|
67
71
|
"unicorn/no-await-expression-member": "error",
|
|
68
72
|
"unicorn/no-await-in-promise-methods": "error",
|
|
69
73
|
"unicorn/no-console-spaces": "error",
|
|
@@ -72,6 +76,7 @@ const unicornRules = {
|
|
|
72
76
|
"unicorn/no-for-loop": "error",
|
|
73
77
|
"unicorn/no-hex-escape": "error",
|
|
74
78
|
"unicorn/no-instanceof-array": "error",
|
|
79
|
+
"unicorn/no-instanceof-builtins": "error",
|
|
75
80
|
"unicorn/no-invalid-fetch-options": "error",
|
|
76
81
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
77
82
|
"unicorn/no-keyword-prefix": [
|
|
@@ -81,9 +86,9 @@ const unicornRules = {
|
|
|
81
86
|
onlyCamelCase: true
|
|
82
87
|
}
|
|
83
88
|
],
|
|
84
|
-
"unicorn/no-length-as-slice-end": "error",
|
|
85
89
|
"unicorn/no-lonely-if": "error",
|
|
86
90
|
"unicorn/no-magic-array-flat-depth": "error",
|
|
91
|
+
"unicorn/no-named-default": "error",
|
|
87
92
|
"unicorn/no-negated-condition": "error",
|
|
88
93
|
"unicorn/no-negation-in-equality-check": "error",
|
|
89
94
|
"unicorn/no-nested-ternary": "error",
|
|
@@ -97,11 +102,15 @@ const unicornRules = {
|
|
|
97
102
|
"unicorn/no-thenable": "error",
|
|
98
103
|
"unicorn/no-this-assignment": "error",
|
|
99
104
|
"unicorn/no-typeof-undefined": "error",
|
|
105
|
+
"unicorn/no-unnecessary-array-flat-depth": "error",
|
|
106
|
+
"unicorn/no-unnecessary-array-splice-count": "error",
|
|
100
107
|
"unicorn/no-unnecessary-await": "error",
|
|
101
108
|
"unicorn/no-unnecessary-polyfills": "error",
|
|
109
|
+
"unicorn/no-unnecessary-slice-end": "error",
|
|
102
110
|
"unicorn/no-unreadable-array-destructuring": "error",
|
|
103
111
|
"unicorn/no-unreadable-iife": "error",
|
|
104
112
|
"unicorn/no-unused-properties": "error",
|
|
113
|
+
"unicorn/no-useless-error-capture-stack-trace": "error",
|
|
105
114
|
"unicorn/no-useless-fallback-in-spread": "error",
|
|
106
115
|
"unicorn/no-useless-length-check": "error",
|
|
107
116
|
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
@@ -109,7 +118,12 @@ const unicornRules = {
|
|
|
109
118
|
"unicorn/no-useless-switch-case": "error",
|
|
110
119
|
"unicorn/no-useless-undefined": "error",
|
|
111
120
|
"unicorn/no-zero-fractions": "error",
|
|
112
|
-
"unicorn/number-literal-case":
|
|
121
|
+
"unicorn/number-literal-case": [
|
|
122
|
+
"error",
|
|
123
|
+
{
|
|
124
|
+
hexadecimalValue: "uppercase"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
113
127
|
"unicorn/numeric-separators-style": [
|
|
114
128
|
"error",
|
|
115
129
|
{
|
|
@@ -140,6 +154,7 @@ const unicornRules = {
|
|
|
140
154
|
"unicorn/prefer-array-some": "error",
|
|
141
155
|
"unicorn/prefer-at": "error",
|
|
142
156
|
"unicorn/prefer-blob-reading-methods": "error",
|
|
157
|
+
"unicorn/prefer-class-fields": "error",
|
|
143
158
|
"unicorn/prefer-code-point": "error",
|
|
144
159
|
"unicorn/prefer-date-now": "error",
|
|
145
160
|
"unicorn/prefer-default-parameters": "error",
|
|
@@ -150,6 +165,7 @@ const unicornRules = {
|
|
|
150
165
|
"unicorn/prefer-event-target": "error",
|
|
151
166
|
"unicorn/prefer-export-from": "error",
|
|
152
167
|
"unicorn/prefer-global-this": "error",
|
|
168
|
+
"unicorn/prefer-import-meta-properties": "error",
|
|
153
169
|
"unicorn/prefer-includes": "error",
|
|
154
170
|
"unicorn/prefer-json-parse-buffer": "off",
|
|
155
171
|
"unicorn/prefer-keyboard-event-key": "error",
|
|
@@ -176,6 +192,7 @@ const unicornRules = {
|
|
|
176
192
|
"unicorn/prefer-regexp-test": "error",
|
|
177
193
|
"unicorn/prefer-set-has": "error",
|
|
178
194
|
"unicorn/prefer-set-size": "error",
|
|
195
|
+
"unicorn/prefer-single-call": "error",
|
|
179
196
|
"unicorn/prefer-spread": "error",
|
|
180
197
|
"unicorn/prefer-string-raw": "error",
|
|
181
198
|
"unicorn/prefer-string-replace-all": "error",
|
|
@@ -190,6 +207,7 @@ const unicornRules = {
|
|
|
190
207
|
"unicorn/prevent-abbreviations": "error",
|
|
191
208
|
"unicorn/relative-url-style": "error",
|
|
192
209
|
"unicorn/require-array-join-separator": "error",
|
|
210
|
+
"unicorn/require-module-specifiers": "error",
|
|
193
211
|
"unicorn/require-number-to-fixed-digits-argument": "error",
|
|
194
212
|
"unicorn/require-post-message-target-origin": "off",
|
|
195
213
|
"unicorn/string-content": [
|
package/rules.js
CHANGED
|
@@ -1,42 +1,62 @@
|
|
|
1
1
|
import { join } from "@std/path";
|
|
2
2
|
|
|
3
|
+
import denoJson from "../deno.json" with { type: "json" };
|
|
4
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
5
|
+
|
|
3
6
|
const {
|
|
4
7
|
cwd,
|
|
5
|
-
readTextFile,
|
|
6
8
|
writeTextFile
|
|
7
9
|
} = Deno;
|
|
8
10
|
|
|
9
|
-
const importMapFilePath = join(cwd(), "deno.json");
|
|
10
|
-
const importMapFileContent = await readTextFile(importMapFilePath);
|
|
11
|
-
const importMap = JSON.parse(importMapFileContent);
|
|
12
|
-
|
|
13
11
|
const packageJsonFilePath = join(cwd(), "package.json");
|
|
14
|
-
const packageJsonFileContent = await readTextFile(packageJsonFilePath);
|
|
15
|
-
const packageJson = JSON.parse(packageJsonFileContent);
|
|
16
12
|
|
|
17
13
|
const collator = new Intl.Collator("en", {
|
|
18
14
|
numeric: true
|
|
19
15
|
});
|
|
20
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Parses the version from a URL.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} url - The URL to parse.
|
|
21
|
+
* @returns {string} - The parsed version.
|
|
22
|
+
*/
|
|
23
|
+
const parseVersion = (url) => url.replace(/^npm:.*?@(?=[^@]+$)/v, "");
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Converts import map entries to a sorted array of tuples with specificer and version.
|
|
27
|
+
*
|
|
28
|
+
* @param {readonly (readonly [string, string])[]} entries - The import map entries to convert.
|
|
29
|
+
* @returns {readonly (readonly [string, string])[]} - The sorted array of tuples.
|
|
30
|
+
*/
|
|
31
|
+
const convertImportMapEntries = (entries) => entries
|
|
32
|
+
.map(([specificer, url]) => /** @type {const} */ ([specificer, parseVersion(url)]))
|
|
33
|
+
.toSorted((
|
|
34
|
+
[packageNameA],
|
|
35
|
+
[packageNameB]
|
|
36
|
+
) => collator.compare(
|
|
37
|
+
packageNameA,
|
|
38
|
+
packageNameB
|
|
39
|
+
));
|
|
40
|
+
|
|
21
41
|
const updatedPackageJson = {
|
|
22
42
|
...packageJson,
|
|
23
43
|
dependencies: Object.fromEntries(
|
|
24
|
-
|
|
25
|
-
|
|
44
|
+
convertImportMapEntries(
|
|
45
|
+
Object.entries(denoJson.imports)
|
|
46
|
+
.filter(([specifier, url]) => url.startsWith("npm:") && specifier !== "eslint")
|
|
47
|
+
)
|
|
48
|
+
),
|
|
49
|
+
devDependencies: Object.fromEntries(
|
|
50
|
+
convertImportMapEntries(
|
|
51
|
+
Object.entries(denoJson.imports)
|
|
52
|
+
.filter(([specifier, url]) => url.startsWith("npm:") && specifier === "eslint")
|
|
53
|
+
)
|
|
54
|
+
),
|
|
55
|
+
peerDependencies: Object.fromEntries(
|
|
56
|
+
convertImportMapEntries(
|
|
57
|
+
Object.entries(denoJson.imports)
|
|
58
|
+
.filter(([specifier, url]) => url.startsWith("npm:") && specifier === "eslint")
|
|
26
59
|
)
|
|
27
|
-
.filter(([specifier, url]) => url.startsWith("npm:"))
|
|
28
|
-
.map(([specificer, url]) => {
|
|
29
|
-
const version = url.replace(/^npm:.*?@(?<version>[^@]+)$/v, "$<version>");
|
|
30
|
-
|
|
31
|
-
return [specificer, version];
|
|
32
|
-
})
|
|
33
|
-
.toSorted((
|
|
34
|
-
[packageNameA],
|
|
35
|
-
[packageNameB]
|
|
36
|
-
) => collator.compare(
|
|
37
|
-
packageNameA,
|
|
38
|
-
packageNameB
|
|
39
|
-
))
|
|
40
60
|
)
|
|
41
61
|
};
|
|
42
62
|
|
package/.tool-versions
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodejs 22.5.1
|