@pumpn/eslint-config 15.5.3 → 15.6.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 +15 -0
- package/deno.json +9 -8
- package/deno.lock +1047 -1375
- package/package.json +11 -15
- package/rules/func-params-args.js +1 -0
- package/rules/import-x/static-analysis.js +1 -1
- package/rules/jsdoc.js +1 -1
- package/rules/perfectionist.js +49 -48
- package/rules/regexp/best-practices.js +1 -2
- package/rules/unicorn.js +10 -10
- package/scripts/update-package-json.js +46 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pumpn/eslint-config",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.6.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,31 @@
|
|
|
17
17
|
"test": "echo 'no tests yet'"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"eslint": "^9.
|
|
20
|
+
"eslint": "^9.19.0"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
24
24
|
"@eslint-react/eslint-plugin": "^1.15.0",
|
|
25
|
-
"@stylistic/eslint-plugin": "^
|
|
25
|
+
"@stylistic/eslint-plugin": "^3.0.1",
|
|
26
26
|
"@typescript-eslint/parser": "^8.11.0",
|
|
27
|
-
"eslint-plugin-depend": "^0.
|
|
27
|
+
"eslint-plugin-depend": "^0.12.0",
|
|
28
28
|
"eslint-plugin-disable-autofix": "^5.0.1",
|
|
29
29
|
"eslint-plugin-func-params-args": "^4.0.0",
|
|
30
30
|
"eslint-plugin-import-x": "^4.3.1",
|
|
31
31
|
"eslint-plugin-jsdoc": "^50.4.3",
|
|
32
|
-
"eslint-plugin-no-secrets": "^
|
|
33
|
-
"eslint-plugin-perfectionist": "^
|
|
32
|
+
"eslint-plugin-no-secrets": "^2.2.1",
|
|
33
|
+
"eslint-plugin-perfectionist": "^4.8.0",
|
|
34
34
|
"eslint-plugin-promise": "^7.1.0",
|
|
35
|
+
"eslint-plugin-react": "^7.35.0",
|
|
35
36
|
"eslint-plugin-redos": "^4.4.5",
|
|
36
37
|
"eslint-plugin-regexp": "^2.6.0",
|
|
37
38
|
"eslint-plugin-security": "^3.0.1",
|
|
38
|
-
"eslint-plugin-sonarjs": "^
|
|
39
|
-
"eslint-plugin-tailwindcss": "^3.
|
|
39
|
+
"eslint-plugin-sonarjs": "^3.0.1",
|
|
40
|
+
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
40
41
|
"eslint-plugin-unicorn": "^56.0.0",
|
|
41
|
-
"globals": "^15.
|
|
42
|
+
"globals": "^15.14.0"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
44
|
-
"eslint": "^9.
|
|
45
|
-
},
|
|
46
|
-
"overrides": {
|
|
47
|
-
"@typescript-eslint/type-utils": "^8.11.0",
|
|
48
|
-
"@typescript-eslint/utils": "^8.11.0",
|
|
49
|
-
"eslint": "^9.13.0"
|
|
45
|
+
"eslint": "^9.19.0"
|
|
50
46
|
}
|
|
51
47
|
}
|
|
@@ -57,7 +57,7 @@ const staticAnalysisRules = {
|
|
|
57
57
|
}
|
|
58
58
|
],
|
|
59
59
|
"import-x/no-self-import": "error",
|
|
60
|
-
// TODO [
|
|
60
|
+
// TODO [2025-03-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
package/rules/perfectionist.js
CHANGED
|
@@ -17,12 +17,12 @@ const perfectionistRules = {
|
|
|
17
17
|
{
|
|
18
18
|
groups: [
|
|
19
19
|
"index-signature",
|
|
20
|
+
["private-static-property", "private-static-accessor-property"],
|
|
21
|
+
["private-static-get-method", "private-static-set-method"],
|
|
20
22
|
["static-property", "static-accessor-property"],
|
|
21
23
|
["static-get-method", "static-set-method"],
|
|
22
24
|
["protected-static-property", "protected-static-accessor-property"],
|
|
23
25
|
["protected-static-get-method", "protected-static-set-method"],
|
|
24
|
-
["private-static-property", "private-static-accessor-property"],
|
|
25
|
-
["private-static-get-method", "private-static-set-method"],
|
|
26
26
|
"static-block",
|
|
27
27
|
["property", "accessor-property"],
|
|
28
28
|
["get-method", "set-method"],
|
|
@@ -39,7 +39,7 @@ const perfectionistRules = {
|
|
|
39
39
|
["private-method", "private-function-property"],
|
|
40
40
|
"unknown"
|
|
41
41
|
],
|
|
42
|
-
partitionByComment:
|
|
42
|
+
partitionByComment: String.raw`\/\/`
|
|
43
43
|
}
|
|
44
44
|
],
|
|
45
45
|
"perfectionist/sort-enums": ["error"],
|
|
@@ -50,12 +50,12 @@ const perfectionistRules = {
|
|
|
50
50
|
customGroups: {
|
|
51
51
|
type: {},
|
|
52
52
|
value: {
|
|
53
|
-
components: "
|
|
54
|
-
islands: "
|
|
55
|
-
logic: "
|
|
56
|
-
plugins: "
|
|
57
|
-
std: "
|
|
58
|
-
utilities: "
|
|
53
|
+
components: "^@/components/.*",
|
|
54
|
+
islands: "^@/islands/.*",
|
|
55
|
+
logic: "^@/logic/.*",
|
|
56
|
+
plugins: "^@/plugins/.*",
|
|
57
|
+
std: "^@std/.*",
|
|
58
|
+
utilities: "^@/utilities/.*"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
groups: [
|
|
@@ -79,8 +79,9 @@ const perfectionistRules = {
|
|
|
79
79
|
"index",
|
|
80
80
|
"unknown"
|
|
81
81
|
],
|
|
82
|
-
internalPattern: ["
|
|
82
|
+
internalPattern: ["^@/.*"],
|
|
83
83
|
newlinesBetween: "always",
|
|
84
|
+
partitionByNewLine: false,
|
|
84
85
|
sortSideEffects: true
|
|
85
86
|
}
|
|
86
87
|
],
|
|
@@ -104,46 +105,46 @@ const perfectionistRules = {
|
|
|
104
105
|
"error",
|
|
105
106
|
{
|
|
106
107
|
customGroups: {
|
|
107
|
-
id: ["id"],
|
|
108
|
-
groupBeforeAfter1: ["before
|
|
109
|
-
groupBeforeAfter2: ["after
|
|
110
|
-
groupColor1: ["r", "l"],
|
|
108
|
+
id: ["^id$"],
|
|
109
|
+
groupBeforeAfter1: ["^before.*"],
|
|
110
|
+
groupBeforeAfter2: ["^after.*"],
|
|
111
|
+
groupColor1: ["^r$", "^l$"],
|
|
111
112
|
groupColor2: [
|
|
112
|
-
"g",
|
|
113
|
-
"c",
|
|
114
|
-
"a"
|
|
113
|
+
"^g$",
|
|
114
|
+
"^c$",
|
|
115
|
+
"^a$"
|
|
115
116
|
],
|
|
116
|
-
groupColor3: ["b", "h"],
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
groupPrecedenceOrdinal1: ["primary
|
|
122
|
-
groupPrecedenceOrdinal2: ["secondary
|
|
123
|
-
groupPrecedenceOrdinal3: ["tertiary
|
|
124
|
-
groupPrecedenceOrdinal4: ["quaternary
|
|
125
|
-
groupPrecedenceOrdinal5: ["quinary
|
|
126
|
-
groupPrecedenceOrdinal6: ["senary
|
|
127
|
-
groupPrecedenceOrdinal7: ["septenary
|
|
128
|
-
groupPrecedenceOrdinal8: ["octonary
|
|
129
|
-
groupPrecedenceOrdinal9: ["nonary
|
|
130
|
-
groupPrecedenceOrdinal10: ["denary
|
|
131
|
-
groupPrecedenceOrdinalLast: ["ultimate
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
groupSpatialOrdinal1: ["first
|
|
137
|
-
groupSpatialOrdinal2: ["second
|
|
138
|
-
groupSpatialOrdinal3: ["third
|
|
139
|
-
groupSpatialOrdinal4: ["fourth
|
|
140
|
-
groupSpatialOrdinal5: ["fifth
|
|
141
|
-
groupSpatialOrdinal6: ["sixth
|
|
142
|
-
groupSpatialOrdinal7: ["seventh
|
|
143
|
-
groupSpatialOrdinal8: ["eighth
|
|
144
|
-
groupSpatialOrdinal9: ["ninth
|
|
145
|
-
groupSpatialOrdinal10: ["tenth
|
|
146
|
-
groupSpatialOrdinalLast: ["last
|
|
117
|
+
groupColor3: ["^b$", "^h$"],
|
|
118
|
+
groupMinimumMaximum1: ["^minimum(([A-Z].*)|$)"],
|
|
119
|
+
groupMinimumMaximum2: ["^maximum(([A-Z].*)|$)"],
|
|
120
|
+
groupMinMax1: ["^min(([A-Z_-].*)|$)"],
|
|
121
|
+
groupMinMax2: ["^max(([A-Z_-].*)|$)"],
|
|
122
|
+
groupPrecedenceOrdinal1: ["^primary.*"],
|
|
123
|
+
groupPrecedenceOrdinal2: ["^secondary.*"],
|
|
124
|
+
groupPrecedenceOrdinal3: ["^tertiary.*"],
|
|
125
|
+
groupPrecedenceOrdinal4: ["^quaternary.*"],
|
|
126
|
+
groupPrecedenceOrdinal5: ["^quinary.*"],
|
|
127
|
+
groupPrecedenceOrdinal6: ["^senary.*"],
|
|
128
|
+
groupPrecedenceOrdinal7: ["^septenary.*"],
|
|
129
|
+
groupPrecedenceOrdinal8: ["^octonary.*"],
|
|
130
|
+
groupPrecedenceOrdinal9: ["^nonary.*"],
|
|
131
|
+
groupPrecedenceOrdinal10: ["^denary.*"],
|
|
132
|
+
groupPrecedenceOrdinalLast: ["^ultimate.*"],
|
|
133
|
+
groupPreviousNext1: ["^previous.*"],
|
|
134
|
+
groupPreviousNext2: ["^next.*"],
|
|
135
|
+
groupPrevNext1: ["^prev(?!ent).*"],
|
|
136
|
+
groupPrevNext2: ["^next.*"],
|
|
137
|
+
groupSpatialOrdinal1: ["^first.*"],
|
|
138
|
+
groupSpatialOrdinal2: ["^second.*"],
|
|
139
|
+
groupSpatialOrdinal3: ["^third.*"],
|
|
140
|
+
groupSpatialOrdinal4: ["^fourth.*"],
|
|
141
|
+
groupSpatialOrdinal5: ["^fifth.*"],
|
|
142
|
+
groupSpatialOrdinal6: ["^sixth.*"],
|
|
143
|
+
groupSpatialOrdinal7: ["^seventh.*"],
|
|
144
|
+
groupSpatialOrdinal8: ["^eighth.*"],
|
|
145
|
+
groupSpatialOrdinal9: ["^ninth.*"],
|
|
146
|
+
groupSpatialOrdinal10: ["^tenth.*"],
|
|
147
|
+
groupSpatialOrdinalLast: ["^last.*"]
|
|
147
148
|
},
|
|
148
149
|
groups: [
|
|
149
150
|
"id",
|
|
@@ -33,8 +33,7 @@ const bestPracticesRules = {
|
|
|
33
33
|
"regexp/prefer-regexp-test": "off",
|
|
34
34
|
"regexp/prefer-set-operation": "error",
|
|
35
35
|
"regexp/require-unicode-regexp": "error",
|
|
36
|
-
|
|
37
|
-
"regexp/require-unicode-sets-regexp": "off",
|
|
36
|
+
"regexp/require-unicode-sets-regexp": "error",
|
|
38
37
|
"regexp/simplify-set-operations": "error",
|
|
39
38
|
"regexp/sort-alternatives": "error",
|
|
40
39
|
"regexp/use-ignore-case": "error"
|
package/rules/unicorn.js
CHANGED
|
@@ -9,29 +9,29 @@ const numberGroupLength = 3;
|
|
|
9
9
|
|
|
10
10
|
const patterns = {
|
|
11
11
|
"'": "’",
|
|
12
|
-
"(
|
|
12
|
+
"(?<=“[^“]*?\\s)['‘]([^'‘]+?)['’](?=\\s[^“]*?”)": "‘$1’",
|
|
13
13
|
"(?<=[!?])”\\.(?=(?:(?:\\s+[\\p{Letter}\\p{Number}])|$))": "”",
|
|
14
|
+
"(?<=[!?])\\.": "",
|
|
14
15
|
"(?<=[\\p{Letter}\\p{Number}] )-+(?= [\\p{Letter}\\p{Number}])": "—",
|
|
15
16
|
"(?<=\\p{Punctuation})\\p{Zs}{2,}(?=[\\p{Letter}\\p{Number}])": " ",
|
|
16
|
-
"(?<=“[^“]*?\\s)['‘]([^'‘]+?)['’](?=\\s[^“]*?”)": "‘$1’",
|
|
17
17
|
"([\"'])((?:\\\\.|[^\\\\])*?)\\1": "“$2”",
|
|
18
|
+
"-->": "⟶",
|
|
19
|
+
"->": "→",
|
|
20
|
+
"\\.”\\.(?=(?:(?:\\s+[\\p{Letter}\\p{Number}])|$))": ".”",
|
|
21
|
+
"<-": "←",
|
|
22
|
+
"<--": "⟵",
|
|
23
|
+
"<-->": "⟷",
|
|
24
|
+
"<->": "↔",
|
|
18
25
|
"<=": "≤",
|
|
19
26
|
"<==": "⇐",
|
|
20
27
|
"<===": "⟸",
|
|
21
28
|
"<==>": "⟺",
|
|
22
29
|
"<=>": "⇔",
|
|
23
|
-
"<-": "←",
|
|
24
|
-
"<->": "↔",
|
|
25
|
-
"<--": "⟵",
|
|
26
|
-
"<-->": "⟷",
|
|
27
30
|
"===>": "⟹",
|
|
28
31
|
"==>": "⇒",
|
|
29
32
|
">=": "≥",
|
|
30
33
|
"\\.\\.(?=(?:(?:\\s+[\\p{Letter}\\p{Number}])|$))": ".",
|
|
31
|
-
"\\.\\.\\.": "…"
|
|
32
|
-
"\\.”\\.(?=(?:(?:\\s+[\\p{Letter}\\p{Number}])|$))": ".”",
|
|
33
|
-
"->": "→",
|
|
34
|
-
"-->": "⟶"
|
|
34
|
+
"\\.\\.\\.": "…"
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { join } from "@std/path";
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
cwd,
|
|
5
|
+
readTextFile,
|
|
6
|
+
writeTextFile
|
|
7
|
+
} = Deno;
|
|
8
|
+
|
|
9
|
+
const importMapFilePath = join(cwd(), "deno.json");
|
|
10
|
+
const importMapFileContent = await readTextFile(importMapFilePath);
|
|
11
|
+
const importMap = JSON.parse(importMapFileContent);
|
|
12
|
+
|
|
13
|
+
const packageJsonFilePath = join(cwd(), "package.json");
|
|
14
|
+
const packageJsonFileContent = await readTextFile(packageJsonFilePath);
|
|
15
|
+
const packageJson = JSON.parse(packageJsonFileContent);
|
|
16
|
+
|
|
17
|
+
const collator = new Intl.Collator("en", {
|
|
18
|
+
numeric: true
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const updatedPackageJson = {
|
|
22
|
+
...packageJson,
|
|
23
|
+
dependencies: Object.fromEntries(
|
|
24
|
+
Object.entries(
|
|
25
|
+
importMap.imports
|
|
26
|
+
)
|
|
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
|
+
)
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
await writeTextFile(
|
|
44
|
+
packageJsonFilePath,
|
|
45
|
+
JSON.stringify(updatedPackageJson, null, "\t")
|
|
46
|
+
);
|