@neralabs/rerail-pack-typescript 0.1.2 → 0.1.4

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.
Files changed (29) hide show
  1. package/README.md +268 -7
  2. package/licenses/eslint-plugin-vitest/UPSTREAM.md +4 -4
  3. package/licenses/typescript-eslint/UPSTREAM.md +1058 -4
  4. package/pack.json +29 -1
  5. package/package.json +1 -1
  6. package/rules/typescript-eslint-ban-tslint-comment.json +2 -2
  7. package/rules/typescript-eslint-consistent-type-definitions.json +1 -1
  8. package/rules/typescript-eslint-default-param-last.json +1 -1
  9. package/rules/typescript-eslint-no-array-constructor.json +1 -1
  10. package/rules/typescript-eslint-no-confusing-non-null-assertion.json +4 -4
  11. package/rules/typescript-eslint-no-dupe-class-members.json +1 -1
  12. package/rules/typescript-eslint-no-duplicate-enum-values.json +1 -1
  13. package/rules/typescript-eslint-no-empty-function.json +1 -1
  14. package/rules/typescript-eslint-no-empty-object-type.json +221 -0
  15. package/rules/typescript-eslint-no-extra-non-null-assertion.json +1 -1
  16. package/rules/typescript-eslint-no-import-type-side-effects.json +4 -4
  17. package/rules/typescript-eslint-no-namespace.json +1 -1
  18. package/rules/typescript-eslint-no-non-null-asserted-optional-chain.json +1 -1
  19. package/rules/typescript-eslint-no-non-null-assertion.json +3 -3
  20. package/rules/typescript-eslint-no-unnecessary-type-constraint.json +1 -1
  21. package/rules/typescript-eslint-no-unsafe-declaration-merging.json +250 -0
  22. package/rules/typescript-eslint-no-unsafe-function-type.json +1 -1
  23. package/rules/typescript-eslint-no-unused-expressions.json +1 -1
  24. package/rules/typescript-eslint-no-useless-empty-export.json +1 -1
  25. package/rules/typescript-eslint-prefer-as-const.json +1 -1
  26. package/rules/typescript-eslint-prefer-enum-initializers.json +1 -1
  27. package/rules/typescript-eslint-prefer-literal-enum-member.json +1 -1
  28. package/rules/typescript-eslint-prefer-namespace-keyword.json +1 -1
  29. package/rules/typescript-eslint-triple-slash-reference.json +146 -0
@@ -3,7 +3,7 @@
3
3
  "id": "typescript-eslint-no-non-null-assertion",
4
4
  "revision": 4,
5
5
  "mode": "steer",
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.",
6
+ "description": "Avoid non-null assertions in TypeScript; check for null or undefined explicitly so the type system can verify it.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*.ts",
@@ -83,7 +83,7 @@
83
83
  "violation": {
84
84
  "anchor": "witness.span",
85
85
  "code": "@typescript-eslint/no-non-null-assertion",
86
- "message": "Forbidden non-null assertion.",
86
+ "message": "Replace this ! assertion with an explicit null or undefined check, or with optional chaining.",
87
87
  "suppress": {
88
88
  "eslint": {
89
89
  "rules": [
@@ -187,7 +187,7 @@
187
187
  "violation": {
188
188
  "anchor": "capture.START",
189
189
  "code": "@typescript-eslint/no-non-null-assertion",
190
- "message": "Forbidden non-null assertion.",
190
+ "message": "Replace this ! assertion with an explicit null or undefined check, or with optional chaining.",
191
191
  "suppress": {
192
192
  "eslint": {
193
193
  "rules": [
@@ -3,7 +3,7 @@
3
3
  "id": "typescript-eslint-no-unnecessary-type-constraint",
4
4
  "revision": 4,
5
5
  "mode": "steer",
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`.",
6
+ "description": "Remove extends any and extends unknown constraints from TypeScript type parameters; they constrain nothing.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*.ts",
@@ -0,0 +1,250 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "typescript-eslint-no-unsafe-declaration-merging",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Don't give a TypeScript class and an interface the same name in one scope; the merge adds the interface's members to the class without checking them.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "merged-class-and-interface",
16
+ "forbid": {
17
+ "ast": {
18
+ "language": "typescript",
19
+ "rule": {
20
+ "has": {
21
+ "field": "name",
22
+ "pattern": "$NAME"
23
+ },
24
+ "any": [
25
+ {
26
+ "matches": "class-declaration",
27
+ "inside": {
28
+ "matches": "scope-with-interface"
29
+ }
30
+ },
31
+ {
32
+ "kind": "interface_declaration",
33
+ "not": {
34
+ "has": {
35
+ "field": "type_parameters",
36
+ "kind": "type_parameters"
37
+ }
38
+ },
39
+ "inside": {
40
+ "matches": "scope-with-class"
41
+ }
42
+ }
43
+ ]
44
+ },
45
+ "utils": {
46
+ "class-declaration": {
47
+ "any": [
48
+ {
49
+ "kind": "class_declaration"
50
+ },
51
+ {
52
+ "kind": "abstract_class_declaration"
53
+ }
54
+ ]
55
+ },
56
+ "scope-block": {
57
+ "any": [
58
+ {
59
+ "kind": "program"
60
+ },
61
+ {
62
+ "kind": "statement_block"
63
+ },
64
+ {
65
+ "kind": "switch_body"
66
+ },
67
+ {
68
+ "kind": "for_statement",
69
+ "has": {
70
+ "field": "initializer",
71
+ "kind": "lexical_declaration"
72
+ }
73
+ },
74
+ {
75
+ "kind": "for_in_statement",
76
+ "has": {
77
+ "field": "kind",
78
+ "regex": "^(?:let|const)$"
79
+ }
80
+ },
81
+ {
82
+ "kind": "with_statement"
83
+ }
84
+ ]
85
+ },
86
+ "wrapper": {
87
+ "any": [
88
+ {
89
+ "kind": "export_statement"
90
+ },
91
+ {
92
+ "kind": "ambient_declaration"
93
+ },
94
+ {
95
+ "kind": "switch_case"
96
+ },
97
+ {
98
+ "kind": "switch_default"
99
+ },
100
+ {
101
+ "kind": "if_statement"
102
+ },
103
+ {
104
+ "kind": "else_clause"
105
+ },
106
+ {
107
+ "kind": "while_statement"
108
+ },
109
+ {
110
+ "kind": "do_statement"
111
+ },
112
+ {
113
+ "kind": "labeled_statement"
114
+ },
115
+ {
116
+ "kind": "for_statement",
117
+ "has": {
118
+ "field": "initializer",
119
+ "any": [
120
+ {
121
+ "kind": "variable_declaration"
122
+ },
123
+ {
124
+ "kind": "empty_statement"
125
+ },
126
+ {
127
+ "precedes": {
128
+ "pattern": ";"
129
+ }
130
+ }
131
+ ]
132
+ }
133
+ },
134
+ {
135
+ "kind": "for_in_statement",
136
+ "has": {
137
+ "field": "left",
138
+ "follows": {
139
+ "any": [
140
+ {
141
+ "pattern": "("
142
+ },
143
+ {
144
+ "pattern": "var"
145
+ }
146
+ ]
147
+ }
148
+ }
149
+ }
150
+ ]
151
+ },
152
+ "member-interface": {
153
+ "any": [
154
+ {
155
+ "kind": "interface_declaration",
156
+ "has": {
157
+ "field": "name",
158
+ "pattern": "$OTHER"
159
+ },
160
+ "compare": {
161
+ "left": "OTHER",
162
+ "op": "eq",
163
+ "right": "NAME"
164
+ }
165
+ },
166
+ {
167
+ "matches": "wrapper",
168
+ "has": {
169
+ "matches": "member-interface"
170
+ }
171
+ }
172
+ ]
173
+ },
174
+ "member-class": {
175
+ "any": [
176
+ {
177
+ "matches": "class-declaration",
178
+ "has": {
179
+ "field": "name",
180
+ "pattern": "$OTHER"
181
+ },
182
+ "compare": {
183
+ "left": "OTHER",
184
+ "op": "eq",
185
+ "right": "NAME"
186
+ }
187
+ },
188
+ {
189
+ "matches": "wrapper",
190
+ "has": {
191
+ "matches": "member-class"
192
+ }
193
+ }
194
+ ]
195
+ },
196
+ "scope-with-interface": {
197
+ "any": [
198
+ {
199
+ "matches": "scope-block",
200
+ "has": {
201
+ "matches": "member-interface"
202
+ }
203
+ },
204
+ {
205
+ "matches": "wrapper",
206
+ "inside": {
207
+ "matches": "scope-with-interface"
208
+ }
209
+ }
210
+ ]
211
+ },
212
+ "scope-with-class": {
213
+ "any": [
214
+ {
215
+ "matches": "scope-block",
216
+ "has": {
217
+ "matches": "member-class"
218
+ }
219
+ },
220
+ {
221
+ "matches": "wrapper",
222
+ "inside": {
223
+ "matches": "scope-with-class"
224
+ }
225
+ }
226
+ ]
227
+ }
228
+ }
229
+ }
230
+ },
231
+ "violation": {
232
+ "anchor": "capture.NAME",
233
+ "code": "@typescript-eslint/no-unsafe-declaration-merging",
234
+ "message": "Rename the class or the interface so they don't merge; merged, the class claims the interface's members without implementing them.",
235
+ "suppress": {
236
+ "eslint": {
237
+ "rules": [
238
+ "@typescript-eslint/no-unsafe-declaration-merging"
239
+ ]
240
+ },
241
+ "biome": {
242
+ "rules": [
243
+ "lint/suspicious/noUnsafeDeclarationMerging"
244
+ ]
245
+ }
246
+ }
247
+ }
248
+ }
249
+ ]
250
+ }
@@ -3,7 +3,7 @@
3
3
  "id": "typescript-eslint-no-unsafe-function-type",
4
4
  "revision": 3,
5
5
  "mode": "steer",
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.",
6
+ "description": "Avoid the global Function type in TypeScript; spell out the parameter and return types, since Function accepts any callable.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*.ts",
@@ -1 +1 @@
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
+ {"format":"rerail.policy/v1","id":"typescript-eslint-no-unused-expressions","revision":5,"mode":"steer","description":"Remove TypeScript expression statements that have no effect, such as a bare value or comparison; they are usually a missing call or assignment.","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"]}}}}]}
@@ -3,7 +3,7 @@
3
3
  "id": "typescript-eslint-no-useless-empty-export",
4
4
  "revision": 4,
5
5
  "mode": "steer",
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.",
6
+ "description": "Remove export {} from TypeScript files that already import or export something; the file is a module already.",
7
7
  "scope": { "include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"], "exclude": ["**/*.d.ts", "**/*.d.mts", "**/*.d.cts"] },
8
8
  "clauses": [
9
9
  {
@@ -3,7 +3,7 @@
3
3
  "id": "typescript-eslint-prefer-as-const",
4
4
  "revision": 4,
5
5
  "mode": "steer",
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`.",
6
+ "description": "Use as const instead of repeating a literal as its own type, in assertions or annotations; it states the intent without duplication.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*.ts",
@@ -3,7 +3,7 @@
3
3
  "id": "typescript-eslint-prefer-enum-initializers",
4
4
  "revision": 4,
5
5
  "mode": "steer",
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.",
6
+ "description": "Give every TypeScript enum member an explicit value; implicit numbering shifts when members are added or reordered.",
7
7
  "scope": { "include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"], "exclude": [] },
8
8
  "clauses": [
9
9
  {
@@ -1 +1 @@
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
+ {"format":"rerail.policy/v1","id":"typescript-eslint-prefer-literal-enum-member","revision":5,"mode":"steer","description":"Initialize TypeScript enum members only with literal strings or numbers, not computed values or references to other members.","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"]}}}}]}
@@ -3,7 +3,7 @@
3
3
  "id": "typescript-eslint-prefer-namespace-keyword",
4
4
  "revision": 4,
5
5
  "mode": "steer",
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.",
6
+ "description": "Use the namespace keyword instead of module to declare custom TypeScript namespaces; module is reserved for external module declarations.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*.ts",
@@ -0,0 +1,146 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "typescript-eslint-triple-slash-reference",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Use import declarations instead of triple-slash path references, and drop triple-slash type references to modules the file already imports.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "shared",
16
+ "define": {
17
+ "language": "typescript",
18
+ "utils": {
19
+ "leading-comment": {
20
+ "pattern": "$COMMENT",
21
+ "inside": {
22
+ "kind": "program",
23
+ "stopBy": "neighbor",
24
+ "has": {
25
+ "stopBy": "neighbor",
26
+ "pattern": "$FIRST",
27
+ "any": [
28
+ {
29
+ "regex": "^([^/#]|/[^/*]|#[^!])"
30
+ },
31
+ {
32
+ "compare": {
33
+ "left": "FIRST",
34
+ "op": "eq",
35
+ "right": "COMMENT",
36
+ "text": "node"
37
+ }
38
+ }
39
+ ]
40
+ }
41
+ },
42
+ "compare": {
43
+ "left": "FIRST",
44
+ "op": "eq",
45
+ "right": "COMMENT",
46
+ "text": "node"
47
+ }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ {
53
+ "id": "path-reference",
54
+ "forbid": {
55
+ "ast": {
56
+ "language": "typescript",
57
+ "rule": {
58
+ "kind": "comment",
59
+ "regex": "^///[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*<reference[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*path[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*=[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*[\"|'](?<MODULE>.*)[\"|']",
60
+ "matches": "leading-comment"
61
+ }
62
+ }
63
+ },
64
+ "violation": {
65
+ "anchor": "witness.span",
66
+ "code": "@typescript-eslint/triple-slash-reference",
67
+ "message": "Replace this triple-slash reference to $MODULE with an import declaration.",
68
+ "suppress": {
69
+ "eslint": {
70
+ "rules": [
71
+ "@typescript-eslint/triple-slash-reference"
72
+ ]
73
+ }
74
+ }
75
+ }
76
+ },
77
+ {
78
+ "id": "types-reference",
79
+ "forbid": {
80
+ "ast": {
81
+ "language": "typescript",
82
+ "rule": {
83
+ "kind": "comment",
84
+ "pattern": "$C",
85
+ "regex": "^///[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*<reference[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*types[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*=[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*[\"|'].*[\"|']",
86
+ "matches": "leading-comment",
87
+ "inside": {
88
+ "kind": "program",
89
+ "stopBy": "neighbor",
90
+ "has": {
91
+ "stopBy": "end",
92
+ "kind": "string",
93
+ "pattern": "$SOURCE",
94
+ "inside": {
95
+ "any": [
96
+ {
97
+ "kind": "import_statement"
98
+ },
99
+ {
100
+ "kind": "import_require_clause"
101
+ }
102
+ ],
103
+ "field": "source",
104
+ "stopBy": "neighbor"
105
+ },
106
+ "compare": {
107
+ "left": "MODULE",
108
+ "op": "eq",
109
+ "right": "SPECIFIER"
110
+ }
111
+ }
112
+ }
113
+ },
114
+ "transform": {
115
+ "MODULE": {
116
+ "replace": {
117
+ "source": "$C",
118
+ "replace": "^///[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*<reference[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*types[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*=[\\t\\n\\x0B\\f\\r \\x{A0}\\x{1680}\\x{2000}-\\x{200A}\\x{2028}\\x{2029}\\x{202F}\\x{205F}\\x{3000}\\x{FEFF}]*[\"|'](.*)[\"|'][\\s\\S]*$",
119
+ "by": "$1"
120
+ }
121
+ },
122
+ "SPECIFIER": {
123
+ "substring": {
124
+ "source": "$SOURCE",
125
+ "value": true
126
+ }
127
+ }
128
+ }
129
+ }
130
+ },
131
+ "violation": {
132
+ "anchor": "witness.span",
133
+ "code": "@typescript-eslint/triple-slash-reference",
134
+ "message": "Remove this triple-slash types reference to $MODULE; the file already imports it.",
135
+ "each": "SOURCE",
136
+ "suppress": {
137
+ "eslint": {
138
+ "rules": [
139
+ "@typescript-eslint/triple-slash-reference"
140
+ ]
141
+ }
142
+ }
143
+ }
144
+ }
145
+ ]
146
+ }