@neralabs/rerail-pack-typescript 0.1.0 → 0.1.2
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 +10 -6
- package/licenses/eslint-plugin-vitest/UPSTREAM.md +7 -0
- package/licenses/typescript-eslint/UPSTREAM.md +1277 -1
- package/pack.json +7 -10
- package/package.json +1 -1
- package/rules/typescript-eslint-ban-tslint-comment.json +18 -3
- package/rules/typescript-eslint-consistent-type-definitions.json +1 -1
- package/rules/typescript-eslint-default-param-last.json +3 -3
- package/rules/typescript-eslint-no-array-constructor.json +41 -4
- package/rules/typescript-eslint-no-confusing-non-null-assertion.json +44 -5
- package/rules/typescript-eslint-no-dupe-class-members.json +1 -1
- package/rules/typescript-eslint-no-duplicate-enum-values.json +12 -6
- package/rules/typescript-eslint-no-empty-function.json +1 -1
- package/rules/typescript-eslint-no-extra-non-null-assertion.json +23 -3
- package/rules/typescript-eslint-no-import-type-side-effects.json +44 -5
- package/rules/typescript-eslint-no-namespace.json +28 -8
- package/rules/typescript-eslint-no-non-null-asserted-optional-chain.json +41 -4
- package/rules/typescript-eslint-no-non-null-assertion.json +22 -6
- package/rules/typescript-eslint-no-unnecessary-type-constraint.json +23 -3
- package/rules/typescript-eslint-no-unsafe-function-type.json +7 -6
- package/rules/typescript-eslint-no-unused-expressions.json +1 -1
- package/rules/typescript-eslint-no-useless-empty-export.json +3 -3
- package/rules/typescript-eslint-prefer-as-const.json +22 -6
- package/rules/typescript-eslint-prefer-enum-initializers.json +3 -3
- package/rules/typescript-eslint-prefer-literal-enum-member.json +1 -1
- package/rules/typescript-eslint-prefer-namespace-keyword.json +41 -4
- package/rules/typescript-eslint-no-wrapper-object-types.json +0 -568
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-non-null-asserted-optional-chain",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
6
|
"description": "Port of typescript-eslint's `no-non-null-asserted-optional-chain` rule (https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain). Flags a non-null assertion that ends an optional chain (`x?.y!`), and a parenthesized optional chain that is non-null asserted (`(x?.y)!`, reported at the chain).",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
|
-
"
|
|
9
|
+
"**/*.ts",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -100,7 +103,24 @@
|
|
|
100
103
|
"violation": {
|
|
101
104
|
"anchor": "witness.span",
|
|
102
105
|
"code": "@typescript-eslint/no-non-null-asserted-optional-chain",
|
|
103
|
-
"message": "Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong."
|
|
106
|
+
"message": "Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong.",
|
|
107
|
+
"suppress": {
|
|
108
|
+
"eslint": {
|
|
109
|
+
"rules": [
|
|
110
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"oxlint": {
|
|
114
|
+
"rules": [
|
|
115
|
+
"no-non-null-asserted-optional-chain"
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"biome": {
|
|
119
|
+
"rules": [
|
|
120
|
+
"lint/suspicious/noNonNullAssertedOptionalChain"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
104
124
|
}
|
|
105
125
|
},
|
|
106
126
|
{
|
|
@@ -166,7 +186,24 @@
|
|
|
166
186
|
"violation": {
|
|
167
187
|
"anchor": "capture.CHAIN",
|
|
168
188
|
"code": "@typescript-eslint/no-non-null-asserted-optional-chain",
|
|
169
|
-
"message": "Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong."
|
|
189
|
+
"message": "Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong.",
|
|
190
|
+
"suppress": {
|
|
191
|
+
"eslint": {
|
|
192
|
+
"rules": [
|
|
193
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"oxlint": {
|
|
197
|
+
"rules": [
|
|
198
|
+
"no-non-null-asserted-optional-chain"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"biome": {
|
|
202
|
+
"rules": [
|
|
203
|
+
"lint/suspicious/noNonNullAssertedOptionalChain"
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
}
|
|
170
207
|
}
|
|
171
208
|
}
|
|
172
209
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-non-null-assertion",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
6
|
"description": "typescript-eslint 8.70.1 @typescript-eslint/no-non-null-assertion, default options. Port of typescript-eslint's `no-non-null-assertion` rule (https://typescript-eslint.io/rules/no-non-null-assertion). Flags every non-null assertion `x!`. Where the grammar misparses a prefix operator applied to an assertion (`!x!` as `(!x)!`), the finding starts at the real operand.",
|
|
7
7
|
"scope": {
|
|
@@ -9,11 +9,7 @@
|
|
|
9
9
|
"**/*.ts",
|
|
10
10
|
"**/*.tsx",
|
|
11
11
|
"**/*.mts",
|
|
12
|
-
"**/*.cts"
|
|
13
|
-
"**/*.js",
|
|
14
|
-
"**/*.jsx",
|
|
15
|
-
"**/*.mjs",
|
|
16
|
-
"**/*.cjs"
|
|
12
|
+
"**/*.cts"
|
|
17
13
|
],
|
|
18
14
|
"exclude": []
|
|
19
15
|
},
|
|
@@ -93,6 +89,16 @@
|
|
|
93
89
|
"rules": [
|
|
94
90
|
"@typescript-eslint/no-non-null-assertion"
|
|
95
91
|
]
|
|
92
|
+
},
|
|
93
|
+
"oxlint": {
|
|
94
|
+
"rules": [
|
|
95
|
+
"no-non-null-assertion"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"biome": {
|
|
99
|
+
"rules": [
|
|
100
|
+
"lint/style/noNonNullAssertion"
|
|
101
|
+
]
|
|
96
102
|
}
|
|
97
103
|
}
|
|
98
104
|
}
|
|
@@ -187,6 +193,16 @@
|
|
|
187
193
|
"rules": [
|
|
188
194
|
"@typescript-eslint/no-non-null-assertion"
|
|
189
195
|
]
|
|
196
|
+
},
|
|
197
|
+
"oxlint": {
|
|
198
|
+
"rules": [
|
|
199
|
+
"no-non-null-assertion"
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
"biome": {
|
|
203
|
+
"rules": [
|
|
204
|
+
"lint/style/noNonNullAssertion"
|
|
205
|
+
]
|
|
190
206
|
}
|
|
191
207
|
}
|
|
192
208
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-unnecessary-type-constraint",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
6
|
"description": "Port of typescript-eslint's `no-unnecessary-type-constraint` (https://typescript-eslint.io/rules/no-unnecessary-type-constraint). Flags type parameters constrained to `any` or `unknown`.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
|
-
"
|
|
9
|
+
"**/*.ts",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -59,7 +62,24 @@
|
|
|
59
62
|
"violation": {
|
|
60
63
|
"anchor": "witness.span",
|
|
61
64
|
"code": "@typescript-eslint/no-unnecessary-type-constraint",
|
|
62
|
-
"message": "Constraining the generic type `$NAME` to `$CONSTRAINT` does nothing and is unnecessary."
|
|
65
|
+
"message": "Constraining the generic type `$NAME` to `$CONSTRAINT` does nothing and is unnecessary.",
|
|
66
|
+
"suppress": {
|
|
67
|
+
"eslint": {
|
|
68
|
+
"rules": [
|
|
69
|
+
"@typescript-eslint/no-unnecessary-type-constraint"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"oxlint": {
|
|
73
|
+
"rules": [
|
|
74
|
+
"no-unnecessary-type-constraint"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"biome": {
|
|
78
|
+
"rules": [
|
|
79
|
+
"lint/complexity/noUselessTypeConstraint"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
63
83
|
}
|
|
64
84
|
}
|
|
65
85
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-unsafe-function-type",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
6
|
"description": "typescript-eslint 8.70.1 @typescript-eslint/no-unsafe-function-type, default options. Port of typescript-eslint's `no-unsafe-function-type` rule (https://typescript-eslint.io/rules/no-unsafe-function-type). Flags the global `Function` type used as a type reference, class implements or interface extends: a `type_identifier` reference that `resolves` to no file-local type binding.",
|
|
7
7
|
"scope": {
|
|
@@ -9,11 +9,7 @@
|
|
|
9
9
|
"**/*.ts",
|
|
10
10
|
"**/*.tsx",
|
|
11
11
|
"**/*.mts",
|
|
12
|
-
"**/*.cts"
|
|
13
|
-
"**/*.js",
|
|
14
|
-
"**/*.jsx",
|
|
15
|
-
"**/*.mjs",
|
|
16
|
-
"**/*.cjs"
|
|
12
|
+
"**/*.cts"
|
|
17
13
|
],
|
|
18
14
|
"exclude": []
|
|
19
15
|
},
|
|
@@ -42,6 +38,11 @@
|
|
|
42
38
|
"rules": [
|
|
43
39
|
"@typescript-eslint/no-unsafe-function-type"
|
|
44
40
|
]
|
|
41
|
+
},
|
|
42
|
+
"oxlint": {
|
|
43
|
+
"rules": [
|
|
44
|
+
"no-unsafe-function-type"
|
|
45
|
+
]
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"typescript-eslint-no-unused-expressions","revision":
|
|
1
|
+
{"format":"rerail.policy/v1","id":"typescript-eslint-no-unused-expressions","revision":5,"mode":"steer","description":"Port of typescript-eslint's `no-unused-expressions` (https://typescript-eslint.io/rules/no-unused-expressions), an extension of ESLint's rule,; same document shape as the ESLint port. Flags an expression statement whose expression (through parentheses and TS `as`/`<T>`/`!`/instantiation wrappers) is not a call, `new`, assignment, update, `await`, `yield`, `import()`, `void` or `delete`; directive prologue strings are exempt. tree-sitter reads `e as A.B.C` and `e satisfies A.B.C` (a type name with two or more dots) as a member access on `e as A.B` / `e satisfies A.B`; such a member access is treated as the `as` (unwrapped) or `satisfies` (never flagged, as upstream) it is. Options are declared in the `options` define (the rule's defaults); a variant is a config patch.","scope":{"include":["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"allowShortCircuit":{"type":"boolean","nullable":true,"default":null},"allowTernary":{"type":"boolean","nullable":true,"default":null}}}},{"id":"unused-expression","forbid":{"ast":{"language":"typescript","rule":{"kind":"expression_statement","all":[{"not":{"matches":"directive"}},{"has":{"stopBy":"neighbor","matches":"disallowed"}}]},"utils":{"disallowed":{"any":[{"kind":"array"},{"kind":"arrow_function"},{"kind":"class"},{"kind":"function_expression"},{"kind":"generator_function"},{"kind":"identifier"},{"kind":"undefined"},{"kind":"number"},{"kind":"string"},{"kind":"true"},{"kind":"false"},{"kind":"null"},{"kind":"regex"},{"kind":"template_string"},{"kind":"member_expression","not":{"has":{"field":"object","stopBy":"neighbor","any":[{"kind":"as_expression"},{"kind":"satisfies_expression"}]}}},{"kind":"member_expression","has":{"field":"object","stopBy":"neighbor","kind":"as_expression","has":{"stopBy":"neighbor","all":[{"not":{"kind":"type_arguments"}},{"matches":"disallowed"}]}}},{"kind":"subscript_expression"},{"kind":"meta_property"},{"kind":"object"},{"kind":"sequence_expression"},{"kind":"this"},{"kind":"super"},{"kind":"unary_expression","not":{"has":{"regex":"^(void|delete)$","stopBy":"neighbor"}}},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","all":[{"not":{"kind":"type_arguments"}},{"matches":"disallowed"}]}},{"kind":"as_expression","has":{"stopBy":"neighbor","all":[{"not":{"kind":"type_arguments"}},{"matches":"disallowed"}]}},{"kind":"type_assertion","has":{"stopBy":"neighbor","all":[{"not":{"kind":"type_arguments"}},{"matches":"disallowed"}]}},{"kind":"non_null_expression","has":{"stopBy":"neighbor","all":[{"not":{"kind":"type_arguments"}},{"matches":"disallowed"}]}},{"kind":"instantiation_expression","has":{"stopBy":"neighbor","all":[{"not":{"kind":"type_arguments"}},{"matches":"disallowed"}]}},{"$option":"allowShortCircuit","cases":{"true":[]},"default":[{"kind":"binary_expression"}],"spread":true},{"$option":"allowShortCircuit","cases":{"true":[{"kind":"binary_expression","not":{"has":{"regex":"^(&&|\\|\\||\\?\\?)$","stopBy":"neighbor"}}}]},"default":[],"spread":true},{"$option":"allowShortCircuit","cases":{"true":[{"kind":"binary_expression","has":{"stopBy":"neighbor","follows":{"regex":"^(&&|\\|\\||\\?\\?)$","stopBy":"neighbor"},"matches":"disallowed"}}]},"default":[],"spread":true},{"$option":"allowTernary","cases":{"true":[]},"default":[{"kind":"ternary_expression"}],"spread":true},{"$option":"allowTernary","cases":{"true":[{"kind":"ternary_expression","has":{"stopBy":"neighbor","matches":"disallowed","follows":{"regex":"^[?:]$","stopBy":"neighbor"}}}]},"default":[],"spread":true},{"kind":"call_expression","has":{"kind":"template_string","stopBy":"neighbor"}}]},"directive-like":{"kind":"expression_statement","has":{"kind":"string","stopBy":"neighbor"}},"directive":{"all":[{"matches":"directive-like"},{"inside":{"stopBy":"neighbor","any":[{"kind":"program"},{"kind":"statement_block","inside":{"stopBy":"neighbor","any":[{"kind":"function_declaration"},{"kind":"function_expression"},{"kind":"arrow_function"},{"kind":"generator_function"},{"kind":"generator_function_declaration"},{"kind":"method_definition"},{"kind":"module"},{"kind":"internal_module"}]}}]}},{"not":{"follows":{"stopBy":"end","all":[{"not":{"kind":"comment"}},{"not":{"kind":"hash_bang_line"}},{"not":{"regex":"^\\{$"}},{"not":{"matches":"directive-like"}}]}}}]}}}},"violation":{"anchor":"witness.span","code":"@typescript-eslint/no-unused-expressions","message":"Expected an assignment or function call and instead saw an expression.","suppress":{"eslint":{"rules":["@typescript-eslint/no-unused-expressions"]},"oxlint":{"rules":["no-unused-expressions"]}}}}]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-useless-empty-export",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
6
|
"description": "Port of typescript-eslint's `no-useless-empty-export` rule (https://typescript-eslint.io/rules/no-useless-empty-export). Flags `export {}` when a sibling statement of the same module body is already an import or export; declaration files are excluded by scope.",
|
|
7
|
-
"scope": { "include": ["
|
|
7
|
+
"scope": { "include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"], "exclude": ["**/*.d.ts", "**/*.d.mts", "**/*.d.cts"] },
|
|
8
8
|
"clauses": [
|
|
9
9
|
{
|
|
10
10
|
"id": "useless-empty-export",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
-
"violation": { "anchor": "witness.span", "code": "@typescript-eslint/no-useless-empty-export", "message": "Empty export does nothing and can be removed.", "fix": "" }
|
|
35
|
+
"violation": { "anchor": "witness.span", "code": "@typescript-eslint/no-useless-empty-export", "message": "Empty export does nothing and can be removed.", "fix": "", "suppress": { "eslint": { "rules": ["@typescript-eslint/no-useless-empty-export"] }, "oxlint": { "rules": ["no-useless-empty-export"] }, "biome": { "rules": ["lint/complexity/noUselessEmptyExport"] } } }
|
|
36
36
|
}
|
|
37
37
|
]
|
|
38
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-prefer-as-const",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
6
|
"description": "typescript-eslint 8.70.1 @typescript-eslint/prefer-as-const, default options. Port of typescript-eslint's `prefer-as-const` rule (https://typescript-eslint.io/rules/prefer-as-const). Flags a literal type that repeats the raw text of the literal it asserts (`x as 'a'`, `<'a'>x`) or annotates (`let v: 'a' = 'a'`, class fields); assertions are fixed to `const`.",
|
|
7
7
|
"scope": {
|
|
@@ -9,11 +9,7 @@
|
|
|
9
9
|
"**/*.ts",
|
|
10
10
|
"**/*.tsx",
|
|
11
11
|
"**/*.mts",
|
|
12
|
-
"**/*.cts"
|
|
13
|
-
"**/*.js",
|
|
14
|
-
"**/*.jsx",
|
|
15
|
-
"**/*.mjs",
|
|
16
|
-
"**/*.cjs"
|
|
12
|
+
"**/*.cts"
|
|
17
13
|
],
|
|
18
14
|
"exclude": []
|
|
19
15
|
},
|
|
@@ -119,6 +115,16 @@
|
|
|
119
115
|
"rules": [
|
|
120
116
|
"@typescript-eslint/prefer-as-const"
|
|
121
117
|
]
|
|
118
|
+
},
|
|
119
|
+
"oxlint": {
|
|
120
|
+
"rules": [
|
|
121
|
+
"prefer-as-const"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"biome": {
|
|
125
|
+
"rules": [
|
|
126
|
+
"lint/style/useAsConstAssertion"
|
|
127
|
+
]
|
|
122
128
|
}
|
|
123
129
|
}
|
|
124
130
|
}
|
|
@@ -216,6 +222,16 @@
|
|
|
216
222
|
"rules": [
|
|
217
223
|
"@typescript-eslint/prefer-as-const"
|
|
218
224
|
]
|
|
225
|
+
},
|
|
226
|
+
"oxlint": {
|
|
227
|
+
"rules": [
|
|
228
|
+
"prefer-as-const"
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
"biome": {
|
|
232
|
+
"rules": [
|
|
233
|
+
"lint/style/useAsConstAssertion"
|
|
234
|
+
]
|
|
219
235
|
}
|
|
220
236
|
}
|
|
221
237
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-prefer-enum-initializers",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
6
|
"description": "Port of typescript-eslint's `prefer-enum-initializers` rule (https://typescript-eslint.io/rules/prefer-enum-initializers). Flags enum members without an initializer.",
|
|
7
|
-
"scope": { "include": ["
|
|
7
|
+
"scope": { "include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"], "exclude": [] },
|
|
8
8
|
"clauses": [
|
|
9
9
|
{
|
|
10
10
|
"id": "enum-member-without-initializer",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
"violation": { "anchor": "witness.span", "code": "@typescript-eslint/prefer-enum-initializers", "message": "The value of the member '$NAME' should be explicitly defined." }
|
|
23
|
+
"violation": { "anchor": "witness.span", "code": "@typescript-eslint/prefer-enum-initializers", "message": "The value of the member '$NAME' should be explicitly defined.", "suppress": { "eslint": { "rules": ["@typescript-eslint/prefer-enum-initializers"] }, "oxlint": { "rules": ["prefer-enum-initializers"] }, "biome": { "rules": ["lint/style/useEnumInitializers"] } } }
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"typescript-eslint-prefer-literal-enum-member","revision":
|
|
1
|
+
{"format":"rerail.policy/v1","id":"typescript-eslint-prefer-literal-enum-member","revision":5,"mode":"steer","description":"Port of typescript-eslint's `prefer-literal-enum-member` rule (https://typescript-eslint.io/rules/prefer-literal-enum-member). Reports an enum member initialized with anything but a literal, a template literal without substitutions, or a signed one. Options are declared in the `options` define (the rule's defaults); a variant is a config patch.","scope":{"include":["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"allowBitwiseExpressions":{"type":"boolean","nullable":true,"default":null}}}},{"id":"shared","define":{"language":"typescript","utils":{"r1":{"any":[{"kind":"comment"},{"regex":"^(&|\\^|<<|>>|>>>|\\|)$"},{"regex":"^[-+~()]$"}]},"r2":{"has":{"kind":"string_fragment","pattern":"$SM","stopBy":"neighbor"},"kind":"string"},"r3":{"has":{"kind":"identifier","pattern":"$EN","stopBy":"neighbor"}},"r4":{"has":{"regex":"^(&|\\^|<<|>>|>>>|\\|)$","stopBy":"neighbor"}}}}},{"id":"non-literal-member","forbid":{"ast":{"language":"typescript","utils":{"literal":{"any":[{"kind":"number"},{"kind":"string"},{"kind":"true"},{"kind":"false"},{"kind":"null"},{"kind":"regex"},{"kind":"template_string","not":{"has":{"kind":"template_substitution","stopBy":"neighbor"}}}]},"allowed":{"any":[{"kind":"parenthesized_expression","all":[{"not":{"has":{"not":{"matches":"r1"},"all":[{"not":{"matches":"allowed"}}],"stopBy":"neighbor"}}}]},{"matches":"literal"},{"kind":"unary_expression","all":[{"has":{"regex":"^[-+]$","stopBy":"neighbor"}},{"not":{"has":{"not":{"matches":"r1"},"all":[{"not":{"matches":"allowed"}}],"stopBy":"neighbor"}}}]},{"$option":"allowBitwiseExpressions","cases":{"true":[{"kind":"unary_expression","all":[{"has":{"regex":"^~$","stopBy":"neighbor"}},{"not":{"has":{"not":{"matches":"r1"},"all":[{"not":{"matches":"allowed-bitwise"}}],"stopBy":"neighbor"}}}]}]},"default":[],"spread":true},{"$option":"allowBitwiseExpressions","cases":{"true":[{"kind":"binary_expression","all":[{"matches":"r4"},{"not":{"has":{"not":{"matches":"r1"},"all":[{"not":{"matches":"allowed-bitwise"}}],"stopBy":"neighbor"}}}]}]},"default":[],"spread":true}]},"allowed-bitwise":{"any":[{"kind":"parenthesized_expression","all":[{"not":{"has":{"not":{"matches":"r1"},"all":[{"not":{"matches":"allowed-bitwise"}}],"stopBy":"neighbor"}}}]},{"matches":"literal"},{"kind":"unary_expression","all":[{"has":{"regex":"^[-+]$","stopBy":"neighbor"}},{"not":{"has":{"not":{"matches":"r1"},"all":[{"not":{"matches":"allowed-bitwise"}}],"stopBy":"neighbor"}}}]},{"kind":"unary_expression","all":[{"has":{"regex":"^~$","stopBy":"neighbor"}},{"not":{"has":{"not":{"matches":"r1"},"all":[{"not":{"matches":"allowed-bitwise"}}],"stopBy":"neighbor"}}}]},{"kind":"binary_expression","all":[{"matches":"r4"},{"not":{"has":{"not":{"matches":"r1"},"all":[{"not":{"matches":"allowed-bitwise"}}],"stopBy":"neighbor"}}}]},{"matches":"self-member"}]},"member-named":{"any":[{"kind":"property_identifier","pattern":"$SM"},{"matches":"r2"},{"kind":"enum_assignment","has":{"any":[{"kind":"property_identifier","pattern":"$SM"},{"matches":"r2"}],"stopBy":"neighbor"}}]},"self-member":{"any":[{"kind":"identifier","pattern":"$SM","inside":{"stopBy":"end","kind":"enum_body","has":{"matches":"member-named","stopBy":"neighbor"}}},{"all":[{"any":[{"kind":"member_expression","has":{"kind":"property_identifier","pattern":"$SM","stopBy":"neighbor"}},{"kind":"subscript_expression","has":{"stopBy":"neighbor","matches":"r2"}}]},{"matches":"r3"},{"inside":{"stopBy":"end","kind":"enum_declaration","all":[{"matches":"r3"},{"has":{"kind":"enum_body","has":{"matches":"member-named","stopBy":"neighbor"},"stopBy":"neighbor"}}]}}]}]}},"rule":{"kind":"enum_assignment","all":[{"has":{"any":[{"kind":"property_identifier"},{"kind":"string"},{"kind":"computed_property_name"},{"kind":"number"}],"pattern":"$NAME","precedes":{"regex":"^=$","stopBy":"end"},"stopBy":"neighbor"}},{"has":{"not":{"kind":"comment"},"follows":{"regex":"^=$","stopBy":"end"},"all":[{"not":{"matches":"allowed"}}],"stopBy":"neighbor"}}]}}},"violation":{"anchor":"capture.NAME","code":"@typescript-eslint/prefer-literal-enum-member","message":{"$option":"allowBitwiseExpressions","cases":{"true":"Explicit enum value must only be a literal value (string or number) or a bitwise expression."},"default":"Explicit enum value must only be a literal value (string or number)."},"suppress":{"eslint":{"rules":["@typescript-eslint/prefer-literal-enum-member"]},"oxlint":{"rules":["prefer-literal-enum-member"]},"biome":{"rules":["lint/style/useLiteralEnumMembers"]}}}}]}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-prefer-namespace-keyword",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
6
|
"description": "Port of typescript-eslint's `prefer-namespace-keyword` rule (https://typescript-eslint.io/rules/prefer-namespace-keyword). Flags `module Name {}` declarations with an identifier name; reports the whole declaration (from `declare` when present) and fixes the keyword.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
|
-
"
|
|
9
|
+
"**/*.ts",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -49,7 +52,24 @@
|
|
|
49
52
|
"anchor": "capture.D",
|
|
50
53
|
"code": "@typescript-eslint/prefer-namespace-keyword",
|
|
51
54
|
"message": "Use 'namespace' instead of 'module' to declare custom TypeScript modules.",
|
|
52
|
-
"fix": "namespace"
|
|
55
|
+
"fix": "namespace",
|
|
56
|
+
"suppress": {
|
|
57
|
+
"eslint": {
|
|
58
|
+
"rules": [
|
|
59
|
+
"@typescript-eslint/prefer-namespace-keyword"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"oxlint": {
|
|
63
|
+
"rules": [
|
|
64
|
+
"prefer-namespace-keyword"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"biome": {
|
|
68
|
+
"rules": [
|
|
69
|
+
"lint/suspicious/useNamespaceKeyword"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
53
73
|
}
|
|
54
74
|
},
|
|
55
75
|
{
|
|
@@ -91,7 +111,24 @@
|
|
|
91
111
|
"anchor": "capture.M",
|
|
92
112
|
"code": "@typescript-eslint/prefer-namespace-keyword",
|
|
93
113
|
"message": "Use 'namespace' instead of 'module' to declare custom TypeScript modules.",
|
|
94
|
-
"fix": "namespace"
|
|
114
|
+
"fix": "namespace",
|
|
115
|
+
"suppress": {
|
|
116
|
+
"eslint": {
|
|
117
|
+
"rules": [
|
|
118
|
+
"@typescript-eslint/prefer-namespace-keyword"
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"oxlint": {
|
|
122
|
+
"rules": [
|
|
123
|
+
"prefer-namespace-keyword"
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"biome": {
|
|
127
|
+
"rules": [
|
|
128
|
+
"lint/suspicious/useNamespaceKeyword"
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
95
132
|
}
|
|
96
133
|
}
|
|
97
134
|
]
|