eslint-plugin-etc-misc 1.1.5 → 1.1.7
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/README.md +135 -135
- package/dist/_internal/casing.js +2 -2
- package/dist/_internal/casing.js.map +1 -1
- package/dist/_internal/get-core-rule.d.ts.map +1 -1
- package/dist/_internal/get-core-rule.js +1 -2
- package/dist/_internal/get-core-rule.js.map +1 -1
- package/dist/_internal/rule-deprecation.d.ts +2 -2
- package/dist/_internal/rule-deprecation.d.ts.map +1 -1
- package/dist/_internal/rule-deprecation.js +10 -12
- package/dist/_internal/rule-deprecation.js.map +1 -1
- package/dist/configs.d.ts +2 -1
- package/dist/configs.d.ts.map +1 -1
- package/dist/configs.js.map +1 -1
- package/dist/plugin.cjs +17 -17
- package/dist/plugin.cjs.map +2 -2
- package/dist/rules/no-const-enum.d.ts.map +1 -1
- package/dist/rules/no-const-enum.js +9 -11
- package/dist/rules/no-const-enum.js.map +1 -1
- package/dist/rules/no-misused-generics.d.ts.map +1 -1
- package/dist/rules/no-misused-generics.js.map +1 -1
- package/dist/rules/no-single-line-comment.d.ts.map +1 -1
- package/dist/rules/no-single-line-comment.js +11 -15
- package/dist/rules/no-single-line-comment.js.map +1 -1
- package/dist/rules/no-use-extend-native.js +2 -2
- package/dist/rules/no-use-extend-native.js.map +1 -1
- package/dist/rules/throw-error.d.ts.map +1 -1
- package/dist/rules/throw-error.js +8 -10
- package/dist/rules/throw-error.js.map +1 -1
- package/dist/rules/typescript-no-redundant-undefined-let.js +1 -1
- package/dist/rules/typescript-no-redundant-undefined-let.js.map +1 -1
- package/dist/rules/typescript-no-redundant-undefined-var.js +1 -1
- package/dist/rules/typescript-no-redundant-undefined-var.js.map +1 -1
- package/dist/rules/typescript-prefer-readonly-property.d.ts.map +1 -1
- package/dist/rules/typescript-prefer-readonly-property.js +9 -11
- package/dist/rules/typescript-prefer-readonly-property.js.map +1 -1
- package/dist/rules/typescript-require-prop-type-annotation.d.ts.map +1 -1
- package/dist/rules/typescript-require-prop-type-annotation.js +9 -11
- package/dist/rules/typescript-require-prop-type-annotation.js.map +1 -1
- package/dist/rules/typescript-require-this-void.d.ts.map +1 -1
- package/dist/rules/typescript-require-this-void.js +9 -11
- package/dist/rules/typescript-require-this-void.js.map +1 -1
- package/docs/AGENTS.md +19 -18
- package/docs/docusaurus/blog/authors.yml +11 -11
- package/docs/docusaurus/docusaurus.config.ts +23 -25
- package/docs/docusaurus/package.json +1 -0
- package/docs/docusaurus/sidebars.rules.ts +40 -42
- package/docs/docusaurus/sidebars.ts +20 -20
- package/docs/docusaurus/src/components/GitHubStats.jsx +4 -4
- package/docs/docusaurus/src/js/modernEnhancements.ts +55 -55
- package/docs/docusaurus/src/pages/index.jsx +12 -12
- package/docs/docusaurus/typedoc-plugins/hashToBangLinksCore.d.mts +4 -2
- package/docs/docusaurus/typedoc.config.json +7 -586
- package/docs/rules/consistent-enum-members.md +3 -3
- package/docs/rules/consistent-filename.md +1 -1
- package/docs/rules/getting-started.md +19 -21
- package/docs/rules/no-assign-mutated-array.md +5 -25
- package/docs/rules/no-expression-empty-lines.md +2 -4
- package/docs/rules/no-foreach.md +1 -5
- package/docs/rules/no-function-declare-after-return.md +45 -36
- package/docs/rules/no-use-extend-native.md +6 -6
- package/docs/rules/no-vulnerable.md +11 -11
- package/docs/rules/prefer-includes.md +2 -11
- package/docs/rules/presets/all.md +1 -1
- package/docs/rules/presets/recommended.md +1 -1
- package/docs/rules/require-jsdoc.md +1 -7
- package/docs/rules/sort-array.md +2 -10
- package/docs/rules/typescript-array-callback-return-type.md +5 -17
- package/package.json +13 -5
|
@@ -9,18 +9,18 @@ This rule analyzes TypeScript `TSEnumMember` nodes and validates naming for:
|
|
|
9
9
|
- enum member identifiers (for example `ACTIVE_USER`), and
|
|
10
10
|
- string literal member values when provided.
|
|
11
11
|
|
|
12
|
-
It enforces
|
|
12
|
+
It enforces SCREAMING_SNAKE_CASE in both places.
|
|
13
13
|
|
|
14
14
|
## What this rule reports
|
|
15
15
|
|
|
16
16
|
This rule reports enum members when **neither** of these matches
|
|
17
|
-
|
|
17
|
+
SCREAMING_SNAKE_CASE:
|
|
18
18
|
|
|
19
19
|
- the member identifier name, or
|
|
20
20
|
- the string literal initializer value.
|
|
21
21
|
|
|
22
22
|
In other words, the current implementation accepts a member if either side is
|
|
23
|
-
already
|
|
23
|
+
already SCREAMING_SNAKE_CASE.
|
|
24
24
|
|
|
25
25
|
## Why this rule exists
|
|
26
26
|
|
|
@@ -4,7 +4,7 @@ Enforce filename casing consistency.
|
|
|
4
4
|
|
|
5
5
|
## Targeted pattern scope
|
|
6
6
|
|
|
7
|
-
This rule validates the current file
|
|
7
|
+
This rule validates the current file's stem (filename without extension) against
|
|
8
8
|
one configured casing format.
|
|
9
9
|
|
|
10
10
|
## What this rule reports
|
|
@@ -16,9 +16,7 @@ Enable one preset in your Flat Config:
|
|
|
16
16
|
```ts
|
|
17
17
|
import etcMisc from "eslint-plugin-etc-misc";
|
|
18
18
|
|
|
19
|
-
export default [
|
|
20
|
-
etcMisc.configs.recommended,
|
|
21
|
-
];
|
|
19
|
+
export default [etcMisc.configs.recommended];
|
|
22
20
|
```
|
|
23
21
|
|
|
24
22
|
Use `minimal` or `recommended` first, then move through stricter presets as
|
|
@@ -33,24 +31,24 @@ import tsParser from "@typescript-eslint/parser";
|
|
|
33
31
|
import etcMisc from "eslint-plugin-etc-misc";
|
|
34
32
|
|
|
35
33
|
export default [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
34
|
+
{
|
|
35
|
+
files: ["**/*.{ts,tsx,mts,cts}"],
|
|
36
|
+
languageOptions: {
|
|
37
|
+
parser: tsParser,
|
|
38
|
+
parserOptions: {
|
|
39
|
+
ecmaVersion: "latest",
|
|
40
|
+
// Enable only when using a type-aware preset.
|
|
41
|
+
// projectService: true,
|
|
42
|
+
sourceType: "module",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
plugins: {
|
|
46
|
+
"etc-misc": etcMisc,
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
...etcMisc.configs.recommended.rules,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
54
52
|
];
|
|
55
53
|
```
|
|
56
54
|
|
|
@@ -26,20 +26,12 @@ mutating shared state, which causes subtle bugs.
|
|
|
26
26
|
## ❌ Incorrect
|
|
27
27
|
|
|
28
28
|
```ts
|
|
29
|
-
const names = [
|
|
30
|
-
"c",
|
|
31
|
-
"a",
|
|
32
|
-
"b",
|
|
33
|
-
];
|
|
29
|
+
const names = ["c", "a", "b"];
|
|
34
30
|
const sorted = names.sort();
|
|
35
31
|
```
|
|
36
32
|
|
|
37
33
|
```ts
|
|
38
|
-
const names = [
|
|
39
|
-
"c",
|
|
40
|
-
"a",
|
|
41
|
-
"b",
|
|
42
|
-
];
|
|
34
|
+
const names = ["c", "a", "b"];
|
|
43
35
|
print(names.reverse());
|
|
44
36
|
```
|
|
45
37
|
|
|
@@ -51,29 +43,17 @@ return sorted;
|
|
|
51
43
|
## ✅ Correct
|
|
52
44
|
|
|
53
45
|
```ts
|
|
54
|
-
const names = [
|
|
55
|
-
"c",
|
|
56
|
-
"a",
|
|
57
|
-
"b",
|
|
58
|
-
];
|
|
46
|
+
const names = ["c", "a", "b"];
|
|
59
47
|
names.sort();
|
|
60
48
|
```
|
|
61
49
|
|
|
62
50
|
```ts
|
|
63
|
-
const names = [
|
|
64
|
-
"c",
|
|
65
|
-
"a",
|
|
66
|
-
"b",
|
|
67
|
-
];
|
|
51
|
+
const names = ["c", "a", "b"];
|
|
68
52
|
const sorted = names.slice().sort();
|
|
69
53
|
```
|
|
70
54
|
|
|
71
55
|
```ts
|
|
72
|
-
const names = [
|
|
73
|
-
"c",
|
|
74
|
-
"a",
|
|
75
|
-
"b",
|
|
76
|
-
];
|
|
56
|
+
const names = ["c", "a", "b"];
|
|
77
57
|
const sorted = names.map((name) => name).reverse();
|
|
78
58
|
```
|
|
79
59
|
|
|
@@ -4,7 +4,7 @@ Disallow blank lines inside expression statements.
|
|
|
4
4
|
|
|
5
5
|
## Targeted pattern scope
|
|
6
6
|
|
|
7
|
-
This rule inspects `ExpressionStatement` nodes and checks the expression
|
|
7
|
+
This rule inspects `ExpressionStatement` nodes and checks the expression's raw
|
|
8
8
|
source text for blank lines.
|
|
9
9
|
|
|
10
10
|
It only applies to expression statements and does not inspect declarations,
|
|
@@ -23,9 +23,7 @@ formatting noise.
|
|
|
23
23
|
## ❌ Incorrect
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
|
-
someCall(
|
|
27
|
-
|
|
28
|
-
1);
|
|
26
|
+
someCall(1);
|
|
29
27
|
```
|
|
30
28
|
|
|
31
29
|
## ✅ Correct
|
package/docs/rules/no-foreach.md
CHANGED
|
@@ -61,11 +61,7 @@ Use this option to control which type names are checked.
|
|
|
61
61
|
## Additional examples
|
|
62
62
|
|
|
63
63
|
```ts
|
|
64
|
-
const set = new Set([
|
|
65
|
-
1,
|
|
66
|
-
2,
|
|
67
|
-
3,
|
|
68
|
-
]);
|
|
64
|
+
const set = new Set([1, 2, 3]);
|
|
69
65
|
set.forEach((value) => console.log(value));
|
|
70
66
|
// ❌ reported with default options
|
|
71
67
|
|
|
@@ -15,14 +15,15 @@ which means the following code is syntactically valid and runs without errors:
|
|
|
15
15
|
|
|
16
16
|
```ts
|
|
17
17
|
function publicMethods(obj) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
if (obj instanceof CustomClass) {
|
|
19
|
+
return {
|
|
20
|
+
get: methodGetter(obj), // ← called before its declaration ❌
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function methodGetter(obj) {
|
|
24
|
+
// ← declared after the return
|
|
25
|
+
// …
|
|
26
|
+
}
|
|
26
27
|
}
|
|
27
28
|
```
|
|
28
29
|
|
|
@@ -57,21 +58,25 @@ the `return` statement in the same statement list (`BlockStatement` or
|
|
|
57
58
|
|
|
58
59
|
```ts
|
|
59
60
|
function outer() {
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
return 42;
|
|
62
|
+
function helper() {} // ← 'helper' should be moved before the return
|
|
62
63
|
}
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
```ts
|
|
66
67
|
function publicMethods(obj) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
if (obj) {
|
|
69
|
+
return {
|
|
70
|
+
set: methodSetter(obj),
|
|
71
|
+
get: methodGetter(obj),
|
|
72
|
+
};
|
|
73
|
+
function methodSetter(obj) {
|
|
74
|
+
/* … */
|
|
75
|
+
} // ← should be before return
|
|
76
|
+
function methodGetter(obj) {
|
|
77
|
+
/* … */
|
|
78
|
+
} // ← should be before return
|
|
79
|
+
}
|
|
75
80
|
}
|
|
76
81
|
```
|
|
77
82
|
|
|
@@ -79,21 +84,25 @@ function publicMethods(obj) {
|
|
|
79
84
|
|
|
80
85
|
```ts
|
|
81
86
|
function outer() {
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
function helper() {} // ← declared before the return
|
|
88
|
+
return helper();
|
|
84
89
|
}
|
|
85
90
|
```
|
|
86
91
|
|
|
87
92
|
```ts
|
|
88
93
|
function publicMethods(obj) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
function methodSetter(obj) {
|
|
95
|
+
/* … */
|
|
96
|
+
} // ← before the return
|
|
97
|
+
function methodGetter(obj) {
|
|
98
|
+
/* … */
|
|
99
|
+
} // ← before the return
|
|
100
|
+
if (obj) {
|
|
101
|
+
return {
|
|
102
|
+
set: methodSetter(obj),
|
|
103
|
+
get: methodGetter(obj),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
97
106
|
}
|
|
98
107
|
```
|
|
99
108
|
|
|
@@ -101,8 +110,8 @@ function publicMethods(obj) {
|
|
|
101
110
|
// Arrow functions and function expressions after return are NOT flagged —
|
|
102
111
|
// use no-unreachable for those.
|
|
103
112
|
function outer() {
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
return 1;
|
|
114
|
+
const arrow = () => {}; // not a FunctionDeclaration — not flagged here
|
|
106
115
|
}
|
|
107
116
|
```
|
|
108
117
|
|
|
@@ -139,11 +148,11 @@ This rule has no options.
|
|
|
139
148
|
import etcMisc from "eslint-plugin-etc-misc";
|
|
140
149
|
|
|
141
150
|
export default [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
151
|
+
{
|
|
152
|
+
plugins: { "etc-misc": etcMisc },
|
|
153
|
+
rules: {
|
|
154
|
+
"etc-misc/no-function-declare-after-return": "warn",
|
|
155
|
+
},
|
|
156
|
+
},
|
|
148
157
|
];
|
|
149
158
|
```
|
|
@@ -85,11 +85,11 @@ Using both rules together gives better protection:
|
|
|
85
85
|
import etcMisc from "eslint-plugin-etc-misc";
|
|
86
86
|
|
|
87
87
|
export default [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
{
|
|
89
|
+
plugins: { "etc-misc": etcMisc },
|
|
90
|
+
rules: {
|
|
91
|
+
"etc-misc/no-use-extend-native": "error",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
94
|
];
|
|
95
95
|
```
|
|
@@ -54,11 +54,11 @@ const maybeUnsafe = RegExp(source); // Dynamic value: intentionally not analyzed
|
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
56
|
type Options = [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
{
|
|
58
|
+
ignoreErrors?: boolean;
|
|
59
|
+
permittableComplexities?: Array<"polynomial" | "exponential">;
|
|
60
|
+
timeout?: number | null;
|
|
61
|
+
}?,
|
|
62
62
|
];
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -112,11 +112,11 @@ For example, to allow polynomial but still report exponential:
|
|
|
112
112
|
import etcMisc from "eslint-plugin-etc-misc";
|
|
113
113
|
|
|
114
114
|
export default [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
{
|
|
116
|
+
plugins: { "etc-misc": etcMisc },
|
|
117
|
+
rules: {
|
|
118
|
+
"etc-misc/no-vulnerable": "error",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
121
|
];
|
|
122
122
|
```
|
|
@@ -19,22 +19,13 @@ comparisons.
|
|
|
19
19
|
## ❌ Incorrect
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
const hasValue =
|
|
23
|
-
[
|
|
24
|
-
1,
|
|
25
|
-
2,
|
|
26
|
-
3,
|
|
27
|
-
].indexOf(2) !== -1;
|
|
22
|
+
const hasValue = [1, 2, 3].indexOf(2) !== -1;
|
|
28
23
|
```
|
|
29
24
|
|
|
30
25
|
## ✅ Correct
|
|
31
26
|
|
|
32
27
|
```ts
|
|
33
|
-
const hasValue = [
|
|
34
|
-
1,
|
|
35
|
-
2,
|
|
36
|
-
3,
|
|
37
|
-
].includes(2);
|
|
28
|
+
const hasValue = [1, 2, 3].includes(2);
|
|
38
29
|
```
|
|
39
30
|
|
|
40
31
|
## Behavior and migration notes
|
|
@@ -46,7 +46,7 @@ export default [etcMisc.configs.recommended];
|
|
|
46
46
|
|
|
47
47
|
## Adoption guidance
|
|
48
48
|
|
|
49
|
-
If you don
|
|
49
|
+
If you don't want readonly preference rules yet, start with minimal. Otherwise, start here for a balanced baseline of correctness and maintainability rules. This preset is designed to be a long-term baseline, so it includes some rules that may be initially noisy but are worth fixing early for long-term benefits.
|
|
50
50
|
|
|
51
51
|
This preset now enables a wider "safe baseline" mix:
|
|
52
52
|
|
package/docs/rules/sort-array.md
CHANGED
|
@@ -25,21 +25,13 @@ faster during code review.
|
|
|
25
25
|
## ❌ Incorrect
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
|
-
const statuses = [
|
|
29
|
-
"pending",
|
|
30
|
-
"active",
|
|
31
|
-
"archived",
|
|
32
|
-
];
|
|
28
|
+
const statuses = ["pending", "active", "archived"];
|
|
33
29
|
```
|
|
34
30
|
|
|
35
31
|
## ✅ Correct
|
|
36
32
|
|
|
37
33
|
```ts
|
|
38
|
-
const statuses = [
|
|
39
|
-
"active",
|
|
40
|
-
"archived",
|
|
41
|
-
"pending",
|
|
42
|
-
];
|
|
34
|
+
const statuses = ["active", "archived", "pending"];
|
|
43
35
|
```
|
|
44
36
|
|
|
45
37
|
## Behavior and migration notes
|
|
@@ -18,7 +18,7 @@ type: `Array`, tuple, union-of-arrays, or `ReadonlyArray`.
|
|
|
18
18
|
|
|
19
19
|
### Type checking
|
|
20
20
|
|
|
21
|
-
This rule uses parser services and TypeScript
|
|
21
|
+
This rule uses parser services and TypeScript's type checker to avoid false
|
|
22
22
|
positives on user-defined methods that happen to share method names like `map`.
|
|
23
23
|
|
|
24
24
|
## What this rule reports
|
|
@@ -35,11 +35,7 @@ clarity and catches accidental return-shape drift earlier.
|
|
|
35
35
|
## ❌ Incorrect
|
|
36
36
|
|
|
37
37
|
```ts
|
|
38
|
-
[
|
|
39
|
-
1,
|
|
40
|
-
2,
|
|
41
|
-
3,
|
|
42
|
-
].map((value) => value + 1);
|
|
38
|
+
[1, 2, 3].map((value) => value + 1);
|
|
43
39
|
```
|
|
44
40
|
|
|
45
41
|
```ts
|
|
@@ -49,11 +45,7 @@ users.find((user) => user.id === targetId);
|
|
|
49
45
|
## ✅ Correct
|
|
50
46
|
|
|
51
47
|
```ts
|
|
52
|
-
[
|
|
53
|
-
1,
|
|
54
|
-
2,
|
|
55
|
-
3,
|
|
56
|
-
].map((value): number => value + 1);
|
|
48
|
+
[1, 2, 3].map((value): number => value + 1);
|
|
57
49
|
```
|
|
58
50
|
|
|
59
51
|
```ts
|
|
@@ -85,18 +77,14 @@ This rule has no options.
|
|
|
85
77
|
## Additional examples
|
|
86
78
|
|
|
87
79
|
```ts
|
|
88
|
-
const scores = [
|
|
89
|
-
2,
|
|
90
|
-
4,
|
|
91
|
-
6,
|
|
92
|
-
] as const;
|
|
80
|
+
const scores = [2, 4, 6] as const;
|
|
93
81
|
|
|
94
82
|
const doubled = scores.map((score): number => score * 2);
|
|
95
83
|
```
|
|
96
84
|
|
|
97
85
|
```ts
|
|
98
86
|
const custom = {
|
|
99
|
-
|
|
87
|
+
map: <T>(value: T): T => value,
|
|
100
88
|
};
|
|
101
89
|
|
|
102
90
|
custom.map((value: number) => value + 1);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "eslint-plugin-etc-misc",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.7",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "ESLint Plugin combining eslint-plugin-etc and eslint-plugin-misc!",
|
|
7
7
|
"keywords": [
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"build:types:cjs": "node -e \"require('node:fs').copyFileSync('dist/plugin.d.ts','dist/plugin.d.cts')\"",
|
|
67
67
|
"changelog:generate": "git-cliff --config cliff.toml --output CHANGELOG.md",
|
|
68
68
|
"changelog:preview": "git-cliff --config cliff.toml --unreleased",
|
|
69
|
-
"changelog:release-notes": "git-cliff --config cliff.toml --
|
|
69
|
+
"changelog:release-notes": "git-cliff --config cliff.toml --current --strip all",
|
|
70
70
|
"clean:cache": "node scripts/remove-paths.mjs dist coverage cache .cache .vite .turbo",
|
|
71
71
|
"clean:cache:coverage": "node scripts/remove-paths.mjs coverage .coverage",
|
|
72
72
|
"clean:cache:dist": "node scripts/remove-paths.mjs dist release",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"lint": "cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache",
|
|
104
104
|
"lint:action": "npm run lint:actions",
|
|
105
105
|
"lint:actions": "node scripts/lint-actionlint.mjs",
|
|
106
|
-
"lint:all": "npm run lint && npm run lint:css && npm run lint:prettier && npm run lint:remark && npm run lint:package && npm run lint:secretlint && npm run lint:yaml && npm run lint:actions && npm run lint:circular",
|
|
106
|
+
"lint:all": "npm run lint && npm run lint:css && npm run lint:prettier && npm run lint:remark && npm run lint:package && npm run lint:gitleaks && npm run lint:secretlint && npm run lint:yaml && npm run lint:yamllint && npm run lint:actions && npm run lint:circular",
|
|
107
107
|
"lint:all:fix": "npm run lint:fix && npm run lint:css:fix && npm run lint:prettier:fix && npm run lint:remark && npm run lint:package && npm run lint:secretlint && npm run lint:yaml:fix && npm run lint:actions && npm run lint:circular",
|
|
108
108
|
"lint:all:fix:quiet": "npm run lint:fix:quiet && npm run lint:css:fix && npm run lint:prettier:fix && npm run lint:remark && npm run lint:package && npm run lint:secretlint && npm run lint:yaml:fix && npm run lint:actions && npm run lint:circular",
|
|
109
109
|
"lint:circular": "npm run madge:circular",
|
|
@@ -123,6 +123,7 @@
|
|
|
123
123
|
"lint:exports": "ts-unused-exports tsconfig.json src/plugin.ts --excludePathsFromReport=plugin.ts",
|
|
124
124
|
"lint:fix": "cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache --fix",
|
|
125
125
|
"lint:fix:quiet": "cross-env ESLINT_PROGRESS=off NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache --fix && echo \"Eslint fix done!\"",
|
|
126
|
+
"lint:gitleaks": "gitleaks dir --config .gitleaks.toml .",
|
|
126
127
|
"lint:grype": "grype . -c .grype.yaml --name eslint-plugin-etc-misc",
|
|
127
128
|
"lint:knip": "npm run knip",
|
|
128
129
|
"lint:knip:exports": "npm run knip -- --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates",
|
|
@@ -132,7 +133,7 @@
|
|
|
132
133
|
"lint:node-version-files": "node scripts/sync-node-version-files.mjs --check",
|
|
133
134
|
"lint:orphans": "npm run madge:orphans",
|
|
134
135
|
"lint:package": "npm run lint:node-version-files && npm run lint:package-sort && npm run lint:packagelintrc && echo \"Package.json lint done!\"",
|
|
135
|
-
"lint:package:strict": "npm run lint:node-version-files && npm run lint:package-sort && npm run lint:package-check && npm run lint:packagelintrc && echo \"Package.json lint done!\"",
|
|
136
|
+
"lint:package:strict": "npm run lint:node-version-files && npm run lint:package-sort && npm run lint:package-check:strict && npm run lint:packagelintrc && echo \"Package.json lint done!\"",
|
|
136
137
|
"lint:package-check": "publint && attw --pack .",
|
|
137
138
|
"lint:package-check:strict": "publint && attw --pack . --profile strict --config-path ./.attw.json",
|
|
138
139
|
"lint:package-sort": "sort-package-json \"./package.json\" \"./docs/docusaurus/package.json\"",
|
|
@@ -150,12 +151,14 @@
|
|
|
150
151
|
"lint:unused-deps": "npm run knip -- --dependencies",
|
|
151
152
|
"lint:yaml": "cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache \"**/*.{yml,yaml}\" && echo \"YAML lint done!\"",
|
|
152
153
|
"lint:yaml:fix": "cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache --fix \"**/*.{yml,yaml}\" && echo \"YAML lint (fix) done!\"",
|
|
154
|
+
"lint:yamllint": "yamllint .",
|
|
153
155
|
"madge:circular": "madge --circular --no-spinner --ts-config tsconfig.json --extensions ts,tsx,js,jsx,mjs,cjs,cts,mts ./src --exclude \"(^|[\\/])(test|dist|node_modules|cache|.cache|coverage|build|eslint-inspector|temp|.docusaurus)($|[\\/])|\\.css$\"",
|
|
154
156
|
"madge:leaves": "madge --leaves --no-spinner --ts-config tsconfig.json --extensions ts,tsx,js,jsx,mjs,cjs,cts,mts ./src --exclude \"(^|[\\/])(test|dist|node_modules|cache|.cache|coverage|build|eslint-inspector|temp|.docusaurus)($|[\\/])|\\.css$\"",
|
|
155
157
|
"madge:orphans": "madge --orphans --no-spinner --ts-config tsconfig.json --extensions ts,tsx,js,jsx,mjs,cjs,cts,mts ./src --exclude \"(^|[\\/])(test|dist|node_modules|cache|.cache|coverage|build|eslint-inspector|temp|.docusaurus)($|[\\/])|\\.css$\"",
|
|
156
158
|
"open:coverage": "open-cli coverage/index.html",
|
|
157
159
|
"prepublishOnly": "npm run release:check",
|
|
158
|
-
"release:check": "npm run
|
|
160
|
+
"release:check": "npm run release:verify",
|
|
161
|
+
"release:verify": "npm run lint:all && npm run typecheck && npm run test && npm pack --dry-run",
|
|
159
162
|
"remark:fix": "remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail --quiet --output -- \"*.{md,mdx}\" \"docs/**/*.{md,mdx}\"",
|
|
160
163
|
"remark:test-config": "remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail \"README.md\"",
|
|
161
164
|
"sync:node-version-files": "node scripts/sync-node-version-files.mjs",
|
|
@@ -185,6 +188,7 @@
|
|
|
185
188
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.build.json --noEmit && tsc -p tsconfig.eslint.json --noEmit && tsc -p tsconfig.js.json --noEmit && npm run --workspace docs/docusaurus typecheck",
|
|
186
189
|
"typecheck:all": "npm run typecheck",
|
|
187
190
|
"types:update": "typesync",
|
|
191
|
+
"update-actions": "npx actions-up --yes --style sha",
|
|
188
192
|
"update-deps": "npx ncu -i --install never && npm update --workspaces --force && npm install --force && npm run sync:rules:write"
|
|
189
193
|
},
|
|
190
194
|
"dependencies": {
|
|
@@ -240,6 +244,7 @@
|
|
|
240
244
|
"eslint-formatter-unix": "^9.0.1",
|
|
241
245
|
"fast-check": "^4.8.0",
|
|
242
246
|
"git-cliff": "^2.13.1",
|
|
247
|
+
"gitleaks-config-nick2bad4u": "^1.0.2",
|
|
243
248
|
"gitleaks-secret-scanner": "^2.1.1",
|
|
244
249
|
"htmlhint": "^1.9.2",
|
|
245
250
|
"jscpd": "^4.1.1",
|
|
@@ -249,6 +254,7 @@
|
|
|
249
254
|
"markdown-link-check": "^3.14.2",
|
|
250
255
|
"npm-check-updates": "^22.2.0",
|
|
251
256
|
"npm-package-json-lint": "^10.4.0",
|
|
257
|
+
"npm-package-json-lint-config-nick2bad4u": "^1.0.3",
|
|
252
258
|
"picocolors": "^1.1.1",
|
|
253
259
|
"prettier": "^3.8.3",
|
|
254
260
|
"prettier-config-nick2bad4u": "^1.0.12",
|
|
@@ -264,6 +270,7 @@
|
|
|
264
270
|
"stylelint": "^17.11.0",
|
|
265
271
|
"stylelint-config-nick2bad4u": "^1.0.10",
|
|
266
272
|
"ts-unused-exports": "^11.0.1",
|
|
273
|
+
"tsdoc-config-nick2bad4u": "^1.0.5",
|
|
267
274
|
"typedoc": "^0.28.19",
|
|
268
275
|
"typescript": "^6.0.3",
|
|
269
276
|
"typescript-eslint": "^8.59.3",
|
|
@@ -272,6 +279,7 @@
|
|
|
272
279
|
"vite": "^8.0.12",
|
|
273
280
|
"vite-tsconfig-paths": "^6.1.1",
|
|
274
281
|
"vitest": "^4.1.6",
|
|
282
|
+
"yamllint-config-nick2bad4u": "^1.0.2",
|
|
275
283
|
"yamllint-js": "^0.2.4"
|
|
276
284
|
},
|
|
277
285
|
"peerDependencies": {
|