@neralabs/rerail-pack-typescript 0.1.2 → 0.1.3
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 +172 -0
- package/package.json +1 -1
- package/rules/typescript-eslint-ban-tslint-comment.json +2 -2
- package/rules/typescript-eslint-consistent-type-definitions.json +1 -1
- package/rules/typescript-eslint-default-param-last.json +1 -1
- package/rules/typescript-eslint-no-array-constructor.json +1 -1
- package/rules/typescript-eslint-no-confusing-non-null-assertion.json +4 -4
- package/rules/typescript-eslint-no-dupe-class-members.json +1 -1
- package/rules/typescript-eslint-no-duplicate-enum-values.json +1 -1
- package/rules/typescript-eslint-no-empty-function.json +1 -1
- package/rules/typescript-eslint-no-extra-non-null-assertion.json +1 -1
- package/rules/typescript-eslint-no-import-type-side-effects.json +4 -4
- package/rules/typescript-eslint-no-namespace.json +1 -1
- package/rules/typescript-eslint-no-non-null-asserted-optional-chain.json +1 -1
- package/rules/typescript-eslint-no-non-null-assertion.json +3 -3
- package/rules/typescript-eslint-no-unnecessary-type-constraint.json +1 -1
- package/rules/typescript-eslint-no-unsafe-function-type.json +1 -1
- package/rules/typescript-eslint-no-unused-expressions.json +1 -1
- package/rules/typescript-eslint-no-useless-empty-export.json +1 -1
- package/rules/typescript-eslint-prefer-as-const.json +1 -1
- package/rules/typescript-eslint-prefer-enum-initializers.json +1 -1
- package/rules/typescript-eslint-prefer-literal-enum-member.json +1 -1
- package/rules/typescript-eslint-prefer-namespace-keyword.json +1 -1
package/README.md
CHANGED
|
@@ -38,3 +38,175 @@ Scoring one rule with every false positive and false negative printed:
|
|
|
38
38
|
```sh
|
|
39
39
|
node --import tsx conformance/languages/cli.ts --pack typescript --rule typescript-eslint-no-namespace --fixtures
|
|
40
40
|
```
|
|
41
|
+
|
|
42
|
+
## Rule details
|
|
43
|
+
|
|
44
|
+
What each rule matches beyond its one-line description: exact matching, edge cases, upstream settings and known divergences.
|
|
45
|
+
|
|
46
|
+
### `typescript-eslint-adjacent-overload-signatures`
|
|
47
|
+
|
|
48
|
+
Reports a function, method, call or construct signature whose name was already declared earlier in the same body when the member just before it is not an overload of the same name. Method names are compared as typescript-eslint's getNameFromMember does: literal and identifier keys by static name, a computed identifier by its name, and other computed keys by their source text.
|
|
49
|
+
|
|
50
|
+
### `typescript-eslint-ban-ts-comment`
|
|
51
|
+
|
|
52
|
+
Matches TypeScript's directive regexes on comment text (block comments: last line only); description length counts approximate grapheme clusters. Defaults as upstream: @ts-expect-error allowed with a description of at least 3 characters, @ts-ignore and @ts-nocheck banned, @ts-check allowed.
|
|
53
|
+
|
|
54
|
+
### `typescript-eslint-ban-tslint-comment`
|
|
55
|
+
|
|
56
|
+
Flags comments whose value matches TSLint's enable/disable directive regex; the fix deletes the comment.
|
|
57
|
+
|
|
58
|
+
### `typescript-eslint-class-literal-property-style`
|
|
59
|
+
|
|
60
|
+
Default option `fields`. Flags getters (not `override`) whose first statement returns a literal, unless the class body has a setter of the same member name (typescript-eslint's getStaticMemberAccessValue: computed keys folded, constant bindings followed, `#a` same as `a`). A getter whose computed name has no static value is reported; a setter with none never pairs. The message tells the agent to check for subclasses that override the getter as an accessor, which a field would break (TS2611); the rule cannot see other classes, so it reports these getters as upstream does (NER-1785).
|
|
61
|
+
|
|
62
|
+
### `typescript-eslint-class-methods-use-this`
|
|
63
|
+
|
|
64
|
+
Flags a non-static, non-constructor class method, or a class field initialized with a function or arrow, whose own body never uses `this` or `super`. Nested functions, static blocks and nested class field initializers have their own `this`; arrows share it. Default options.
|
|
65
|
+
|
|
66
|
+
### `typescript-eslint-consistent-generic-constructors`
|
|
67
|
+
|
|
68
|
+
Covers variable declarators, class fields and parameter defaults initialized with `new Name(...)`, default mode `constructor`; typed-array built-ins are excepted. The fix rebuilds the declaration from its parts, so whitespace and comments inside it are not kept, and a declaration with modifiers is not fixed. typescript-eslint skips the constructor-mode report when the `isolatedDeclarations` parser option is set; Rerail has no such fact, so the port reports it and its message says to keep the annotation under isolatedDeclarations (TS9010, NER-1786).
|
|
69
|
+
|
|
70
|
+
### `typescript-eslint-consistent-type-definitions`
|
|
71
|
+
|
|
72
|
+
Default option `interface`: flags type aliases whose type is an object literal type (through any parentheses) and fixes them to interfaces.
|
|
73
|
+
|
|
74
|
+
### `typescript-eslint-default-param-last`
|
|
75
|
+
|
|
76
|
+
Identical to the ESLint base port. Only functions with a body; a trailing rest parameter does not count as required.
|
|
77
|
+
|
|
78
|
+
### `typescript-eslint-explicit-function-return-type`
|
|
79
|
+
|
|
80
|
+
Allowances with defaults: typed function expressions, higher-order functions and direct const assertions in arrows on; expressions, IIFEs, void-started concise arrows, functions without type parameters and allowed names off. Reports at the function head.
|
|
81
|
+
|
|
82
|
+
### `typescript-eslint-explicit-member-accessibility`
|
|
83
|
+
|
|
84
|
+
Reports from the first token after a member's decorators.
|
|
85
|
+
|
|
86
|
+
### `typescript-eslint-max-params`
|
|
87
|
+
|
|
88
|
+
Extends ESLint's max-params; default max 3, countThis `except-void`. Counts parameters of functions, methods, arrows, declared functions and function types; the message names the function as getFunctionNameWithKind does.
|
|
89
|
+
|
|
90
|
+
### `typescript-eslint-member-ordering`
|
|
91
|
+
|
|
92
|
+
Default options only: a member is flagged when an earlier member of the same body belongs to a group ranked later in typescript-eslint's default member-type order.
|
|
93
|
+
|
|
94
|
+
### `typescript-eslint-method-signature-style`
|
|
95
|
+
|
|
96
|
+
Default option `property`. Fixes to a function property except inside a module declaration, when the return type mentions `this`, or when the key is overloaded (typescript-eslint's merged-overload fix is not reproduced).
|
|
97
|
+
|
|
98
|
+
### `typescript-eslint-no-array-constructor`
|
|
99
|
+
|
|
100
|
+
Exempt: exactly one argument, or type arguments. No scope check (typescript-eslint does not resolve `Array` either). Calls with comments inside the argument list get no fix.
|
|
101
|
+
|
|
102
|
+
### `typescript-eslint-no-dupe-class-members`
|
|
103
|
+
|
|
104
|
+
ESLint's base rule over non-computed members only, ignoring overload signatures; compares static names within the same staticness; a getter may pair with a setter.
|
|
105
|
+
|
|
106
|
+
### `typescript-eslint-no-duplicate-enum-values`
|
|
107
|
+
|
|
108
|
+
Initializers considered: string, number or static template literal under any chain of unary + and -; compared by Object.is; NaN and other initializers ignored. Default options (typescript-eslint 8.70.1).
|
|
109
|
+
|
|
110
|
+
### `typescript-eslint-no-dynamic-delete`
|
|
111
|
+
|
|
112
|
+
String, number and negated number literal keys are allowed.
|
|
113
|
+
|
|
114
|
+
### `typescript-eslint-no-empty-function`
|
|
115
|
+
|
|
116
|
+
A body with a comment is not empty; constructors with parameter properties are exempt. Default options (allow: []).
|
|
117
|
+
|
|
118
|
+
### `typescript-eslint-no-extra-non-null-assertion`
|
|
119
|
+
|
|
120
|
+
Parentheses are transparent, as in ESTree.
|
|
121
|
+
|
|
122
|
+
### `typescript-eslint-no-extraneous-class`
|
|
123
|
+
|
|
124
|
+
Only classes without `extends`; a constructor with parameter properties does not count as constructor-only.
|
|
125
|
+
|
|
126
|
+
### `typescript-eslint-no-inferrable-types`
|
|
127
|
+
|
|
128
|
+
Types covered: bigint, boolean, number, null, string, symbol, RegExp, undefined. The fix removes the annotation.
|
|
129
|
+
|
|
130
|
+
### `typescript-eslint-no-invalid-this`
|
|
131
|
+
|
|
132
|
+
Standalone port (extends ESLint's no-invalid-this). Flags `this` whose nearest non-arrow function scope is the module top level or a function ESLint's isDefaultThisBinding treats as called without a receiver. Strictness and the global `this` come from the case's language options: a script's top level and a non-strict function's `this` are valid.
|
|
133
|
+
|
|
134
|
+
### `typescript-eslint-no-invalid-void-type`
|
|
135
|
+
|
|
136
|
+
Port of typescript-eslint `no-invalid-void-type`. void is allowed as a return type (and as the annotation of non-identifier bindings, mirroring the rule's grandparent test); in a union whose members are all void, never, or generics with a void argument; in a union inside a function or method implementation that has overload signatures of the same name (an anonymous `export default function` has them when the module has an `export default function` signature; method names compared like getStaticMemberAccessValue, two names without a static value treated as equal); and, with allowInGenericTypeArguments (default true), as a generic type argument outside a call or as a type parameter default.
|
|
137
|
+
|
|
138
|
+
### `typescript-eslint-no-misused-new`
|
|
139
|
+
|
|
140
|
+
Reports a bodiless class method named `new` returning its own class, an interface construct signature returning its own interface, and a `constructor` method signature in an interface or type literal.
|
|
141
|
+
|
|
142
|
+
### `typescript-eslint-no-namespace`
|
|
143
|
+
|
|
144
|
+
typescript-eslint 8.70.1, default options. allowDefinitionFiles is fixed at its default (true): files matched by isDefinitionFile (`\.d\.(ts|cts|mts|.*\.ts)$`) are not checked. Not flagged: `declare global`, `global {}` inside `declare module 'name'`, and `declare module 'name'`. Declared namespaces are flagged (allowDeclarations default false).
|
|
145
|
+
|
|
146
|
+
### `typescript-eslint-no-non-null-assertion`
|
|
147
|
+
|
|
148
|
+
typescript-eslint 8.70.1, default options. Where tree-sitter misparses a prefix operator applied to an assertion (`!x!` as `(!x)!`), the finding starts at the real operand.
|
|
149
|
+
|
|
150
|
+
### `typescript-eslint-no-non-null-asserted-optional-chain`
|
|
151
|
+
|
|
152
|
+
A parenthesized optional chain that is non-null asserted (`(x?.y)!`) is reported at the chain.
|
|
153
|
+
|
|
154
|
+
### `typescript-eslint-no-redeclare`
|
|
155
|
+
|
|
156
|
+
Flags each definition after the first in the same scope; with builtinGlobals, definitions of a configured or `/* global */`-declared global.
|
|
157
|
+
|
|
158
|
+
### `typescript-eslint-no-require-imports`
|
|
159
|
+
|
|
160
|
+
`require(...)` is not flagged when a declaration of `require` is in scope. Default options: allow [], allowAsImport false.
|
|
161
|
+
|
|
162
|
+
### `typescript-eslint-no-unsafe-function-type`
|
|
163
|
+
|
|
164
|
+
typescript-eslint 8.70.1, default options. Flags `Function` as a type reference, in class implements, or interface extends, only when the name resolves to no file-local type binding.
|
|
165
|
+
|
|
166
|
+
### `typescript-eslint-no-unused-expressions`
|
|
167
|
+
|
|
168
|
+
Unwraps parentheses and TS `as` / `<T>` / `!` / instantiation wrappers; allowed: call, new, assignment, update, await, yield, import(), void, delete; directive prologue strings exempt. tree-sitter reads `e as A.B.C` and `e satisfies A.B.C` (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).
|
|
169
|
+
|
|
170
|
+
### `typescript-eslint-no-unused-vars`
|
|
171
|
+
|
|
172
|
+
Reported where ESLint reports (last write from the variable's own function, else its first definition). Usedness, exports, `/* exported */` comments and report anchors come from the engine's per-variable references (`binds`, `resolves.write: "last"`); options filter on them. An unused `/* global */` name with no declaration is reported at the name in the first comment that declares it (M12a eslintDirective parse; first three names of a comment).
|
|
173
|
+
|
|
174
|
+
### `typescript-eslint-no-useless-constructor`
|
|
175
|
+
|
|
176
|
+
Exempt: private/protected constructors, `public` constructors in derived classes, parameter properties and decorated parameters. Flags an empty-body constructor in a class without extends, or one whose body is only `super(...)` passing parameters through unchanged (ESLint isPassingThrough for any number of simple parameters: positional name match, spread of a rest parameter, or one spread of `arguments`).
|
|
177
|
+
|
|
178
|
+
### `typescript-eslint-no-wrapper-object-types`
|
|
179
|
+
|
|
180
|
+
typescript-eslint 8.70.1, default options. Flags BigInt/Boolean/Number/Object/String/Symbol in type references, implements and interface extends only when the name resolves to no file-local type binding. Type references are auto-fixed to the lowercase primitive.
|
|
181
|
+
|
|
182
|
+
### `typescript-eslint-parameter-properties`
|
|
183
|
+
|
|
184
|
+
Default options, `class-property` mode: flags constructor parameter properties whose modifiers are not in the (empty) allow list.
|
|
185
|
+
|
|
186
|
+
### `typescript-eslint-prefer-as-const`
|
|
187
|
+
|
|
188
|
+
typescript-eslint 8.70.1, default options. 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 auto-fixed to `const`.
|
|
189
|
+
|
|
190
|
+
### `typescript-eslint-prefer-function-type`
|
|
191
|
+
|
|
192
|
+
Applies to a type literal, or an interface with no supertype other than Function, whose only member is a call or construct signature with a return type; in such an interface the first `this` type (outside nested literals) is reported instead. Fixes cover call signatures without comments; checks are split by fix shape.
|
|
193
|
+
|
|
194
|
+
### `typescript-eslint-prefer-literal-enum-member`
|
|
195
|
+
|
|
196
|
+
Allowed initializers: a literal, a template literal without substitutions, or a signed literal; allowBitwiseExpressions option additionally allows bitwise expressions.
|
|
197
|
+
|
|
198
|
+
### `typescript-eslint-prefer-namespace-keyword`
|
|
199
|
+
|
|
200
|
+
Only `module Name {}` with an identifier name; reports the whole declaration (from `declare` when present) and fixes the keyword.
|
|
201
|
+
|
|
202
|
+
### `typescript-eslint-unified-signatures`
|
|
203
|
+
|
|
204
|
+
Compares each overload with every earlier overload of the same name in the same container, pairing parameters by position for any number of parameters, requiring equal return types and type parameters. Not ported: the outer type-parameter usage test and message line numbers. With three or more overloads of a name, the message names the line of the other overload ESLint picks (M12a `line` transform).
|
|
205
|
+
|
|
206
|
+
### `vitest-no-disabled-tests`
|
|
207
|
+
|
|
208
|
+
Disabled forms: `.skip`, `xit`, `xtest`, `xdescribe`, a test with no function, `pending()`.
|
|
209
|
+
|
|
210
|
+
### `typescript-eslint-no-explicit-any`
|
|
211
|
+
|
|
212
|
+
Port of typescript-eslint's `no-explicit-any` rule (https://typescript-eslint.io/rules/no-explicit-any). Flags every `any` type (default options: no fix; the rule only suggests). Options (`ignoreRestArgs`, `fixToUnknown`) are declared in the `options` define with the rule's defaults; a variant is a config patch.
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-ban-tslint-comment",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove TSLint enable and disable comments; TSLint is deprecated and they no longer do anything.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"violation": {
|
|
29
29
|
"anchor": "witness.span",
|
|
30
30
|
"code": "@typescript-eslint/ban-tslint-comment",
|
|
31
|
-
"message": "
|
|
31
|
+
"message": "Delete the \"$TEXT\" comment; TSLint is deprecated and nothing reads it.",
|
|
32
32
|
"fix": "",
|
|
33
33
|
"suppress": {
|
|
34
34
|
"eslint": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"typescript-eslint-consistent-type-definitions","revision":5,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"typescript-eslint-consistent-type-definitions","revision":5,"mode":"steer","description":"Use an interface instead of a type alias to define TypeScript object types.","scope":{"include":["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"option":{"type":"string","nullable":true,"default":null}}}},{"id":"shared","define":{"language":"typescript","utils":{"r1":{"any":[{"has":{"kind":"type_parameters","pattern":"$TP","stopBy":"neighbor"}},{"not":{"has":{"kind":"type_parameters","stopBy":"neighbor"}}}]},"r2":{"inside":{"has":{"regex":"^global$","stopBy":"neighbor"},"kind":"ambient_declaration","stopBy":"end"}},"r3":{"has":{"kind":"type_identifier","pattern":"$N","stopBy":"neighbor"}},"r4":{"has":{"kind":"extends_type_clause","stopBy":"neighbor"}},"r5":{"has":{"kind":"interface_body","pattern":"$B","stopBy":"neighbor"}}}}},{"id":"interface-over-type","forbid":{"ast":{"language":"typescript","rule":{"kind":"type_alias_declaration","all":[{"matches":"r3"},{"has":{"matches":"object-type","stopBy":"neighbor"}},{"matches":"r1"}]},"utils":{"object-type":{"any":[{"kind":"object_type","pattern":"$B","not":{"has":{"kind":"index_signature","stopBy":"neighbor","has":{"kind":"mapped_type_clause","stopBy":"neighbor"}}}},{"kind":"parenthesized_type","has":{"matches":"object-type","stopBy":"neighbor"}}]}},"when":{"option":{"option":{"in":[null,"interface"]}}}}},"violation":{"anchor":"capture.N","code":"@typescript-eslint/consistent-type-definitions","message":"Use an `interface` instead of a `type`.","fix":"interface $N$TP $B","suppress":{"eslint":{"rules":["@typescript-eslint/consistent-type-definitions"]},"oxlint":{"rules":["consistent-type-definitions"]},"biome":{"rules":["lint/style/useConsistentTypeDefinitions"]}}}},{"id":"type-over-interface","forbid":{"ast":{"language":"typescript","rule":{"kind":"interface_declaration","all":[{"matches":"r3"},{"matches":"r5"},{"matches":"r1"},{"not":{"any":[{"matches":"r4"},{"inside":{"kind":"export_statement","stopBy":"neighbor","has":{"regex":"^default$","stopBy":"neighbor"}}},{"matches":"r2"}]}}]},"when":{"option":{"option":"type"}}}},"violation":{"anchor":"capture.N","code":"@typescript-eslint/consistent-type-definitions","message":"Use a `type` instead of an `interface`.","fix":"type $N$TP = $B","suppress":{"eslint":{"rules":["@typescript-eslint/consistent-type-definitions"]},"oxlint":{"rules":["consistent-type-definitions"]},"biome":{"rules":["lint/style/useConsistentTypeDefinitions"]}}}},{"id":"type-over-interface-unfixed","forbid":{"ast":{"language":"typescript","rule":{"kind":"interface_declaration","all":[{"matches":"r3"},{"any":[{"matches":"r4"},{"matches":"r2"}]}]},"when":{"option":{"option":"type"}}}},"violation":{"anchor":"capture.N","code":"@typescript-eslint/consistent-type-definitions","message":"Use a `type` instead of an `interface`.","suppress":{"eslint":{"rules":["@typescript-eslint/consistent-type-definitions"]},"oxlint":{"rules":["consistent-type-definitions"]},"biome":{"rules":["lint/style/useConsistentTypeDefinitions"]}}}},{"id":"type-over-interface-export-default","forbid":{"ast":{"language":"typescript","rule":{"kind":"export_statement","all":[{"has":{"regex":"^default$","stopBy":"neighbor"}},{"has":{"kind":"interface_declaration","stopBy":"neighbor","all":[{"matches":"r3"},{"matches":"r5"},{"matches":"r1"},{"not":{"any":[{"matches":"r4"},{"matches":"r2"}]}}]}}]},"when":{"option":{"option":"type"}}}},"violation":{"anchor":"capture.N","code":"@typescript-eslint/consistent-type-definitions","message":"Use a `type` instead of an `interface`.","fix":"type $N$TP = $B\nexport default $N","suppress":{"eslint":{"rules":["@typescript-eslint/consistent-type-definitions"]},"oxlint":{"rules":["consistent-type-definitions"]},"biome":{"rules":["lint/style/useConsistentTypeDefinitions"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-default-param-last",
|
|
4
4
|
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Put defaulted and optional parameters after required ones in TypeScript functions; callers otherwise can't omit them.",
|
|
7
7
|
"scope": { "include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"], "exclude": [] },
|
|
8
8
|
"clauses": [
|
|
9
9
|
{
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-no-array-constructor",
|
|
4
4
|
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use an array literal instead of Array() or new Array() in TypeScript; the constructor treats a single number argument as a length.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-no-confusing-non-null-assertion",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Avoid a non-null assertion right before =, ==, ===, in or instanceof; it reads like != or a negated test.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"violation": {
|
|
70
70
|
"anchor": "witness.span",
|
|
71
71
|
"code": "@typescript-eslint/no-confusing-non-null-assertion",
|
|
72
|
-
"message": "
|
|
72
|
+
"message": "Wrap the asserted left side in parentheses, `(a!) = b`, so it can't be read as `a != b`.",
|
|
73
73
|
"suppress": {
|
|
74
74
|
"eslint": {
|
|
75
75
|
"rules": [
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"violation": {
|
|
140
140
|
"anchor": "witness.span",
|
|
141
141
|
"code": "@typescript-eslint/no-confusing-non-null-assertion",
|
|
142
|
-
"message": "
|
|
142
|
+
"message": "Wrap the asserted left side in parentheses, `(a!) == b`, so it can't be read as `a !== b`.",
|
|
143
143
|
"suppress": {
|
|
144
144
|
"eslint": {
|
|
145
145
|
"rules": [
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
"violation": {
|
|
211
211
|
"anchor": "witness.span",
|
|
212
212
|
"code": "@typescript-eslint/no-confusing-non-null-assertion",
|
|
213
|
-
"message": "
|
|
213
|
+
"message": "Wrap the asserted left side in parentheses, `(a!) $OP b`, so it can't be read as `!(a $OP b)`.",
|
|
214
214
|
"suppress": {
|
|
215
215
|
"eslint": {
|
|
216
216
|
"rules": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"typescript-eslint-no-dupe-class-members","revision":7,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"typescript-eslint-no-dupe-class-members","revision":7,"mode":"steer","description":"Remove duplicate member names in a TypeScript class; the later one silently overwrites the earlier.","scope":{"include":["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],"exclude":[]},"clauses":[{"id":"duplicate-member","forbid":{"ast":{"language":"typescript","rule":{"all":[{"matches":"member"},{"pattern":"$P"},{"any":[{"has":{"stopBy":"neighbor","matches":"key","not":{"kind":"computed_property_name"},"pattern":"$K"}},{"has":{"stopBy":"neighbor","matches":"key","kind":"computed_property_name","has":{"stopBy":"neighbor","not":{"regex":"^[\\[\\]]$"},"pattern":"$K"}}}]},{"any":[{"all":[{"matches":"static"},{"matches":"get"},{"count":{"follows":{"stopBy":"end","all":[{"matches":"member"},{"matches":"static"},{"not":{"matches":"set"}}],"pattern":"$Q","compare":{"left":"Q","op":"eq","right":"P","text":"key"}},"min":1}}]},{"all":[{"matches":"static"},{"matches":"set"},{"count":{"follows":{"stopBy":"end","all":[{"matches":"member"},{"matches":"static"},{"not":{"matches":"get"}}],"pattern":"$Q","compare":{"left":"Q","op":"eq","right":"P","text":"key"}},"min":1}}]},{"all":[{"matches":"static"},{"all":[{"not":{"matches":"get"}},{"not":{"matches":"set"}}]},{"count":{"follows":{"stopBy":"end","all":[{"matches":"member"},{"matches":"static"}],"pattern":"$Q","compare":{"left":"Q","op":"eq","right":"P","text":"key"}},"min":1}}]},{"all":[{"not":{"matches":"static"}},{"matches":"get"},{"count":{"follows":{"stopBy":"end","all":[{"matches":"member"},{"not":{"matches":"static"}},{"not":{"matches":"set"}}],"pattern":"$Q","compare":{"left":"Q","op":"eq","right":"P","text":"key"}},"min":1}}]},{"all":[{"not":{"matches":"static"}},{"matches":"set"},{"count":{"follows":{"stopBy":"end","all":[{"matches":"member"},{"not":{"matches":"static"}},{"not":{"matches":"get"}}],"pattern":"$Q","compare":{"left":"Q","op":"eq","right":"P","text":"key"}},"min":1}}]},{"all":[{"not":{"matches":"static"}},{"all":[{"not":{"matches":"get"}},{"not":{"matches":"set"}}]},{"count":{"follows":{"stopBy":"end","all":[{"matches":"member"},{"not":{"matches":"static"}}],"pattern":"$Q","compare":{"left":"Q","op":"eq","right":"P","text":"key"}},"min":1}}]}]}]},"utils":{"member":{"all":[{"any":[{"kind":"method_definition"},{"kind":"public_field_definition"}]},{"inside":{"kind":"class_body","stopBy":"neighbor"}},{"not":{"matches":"ctor"}},{"not":{"has":{"stopBy":"neighbor","regex":"^abstract$","not":{"kind":"property_identifier"}}}},{"not":{"has":{"stopBy":"neighbor","regex":"^accessor$","not":{"kind":"property_identifier"}}}},{"not":{"has":{"stopBy":"neighbor","kind":"computed_property_name"}}}]},"key":{"any":[{"kind":"property_identifier"},{"kind":"string"},{"kind":"number"},{"kind":"computed_property_name"},{"kind":"private_property_identifier"}],"not":{"follows":{"stopBy":"end","regex":"^[=(]$"}}},"static":{"has":{"stopBy":"neighbor","regex":"^static$","not":{"kind":"property_identifier"}}},"get":{"kind":"method_definition","has":{"stopBy":"neighbor","regex":"^get$","not":{"kind":"property_identifier"}}},"set":{"kind":"method_definition","has":{"stopBy":"neighbor","regex":"^set$","not":{"kind":"property_identifier"}}},"ctor":{"kind":"method_definition","not":{"has":{"stopBy":"neighbor","regex":"^static$","not":{"kind":"property_identifier"}}},"has":{"stopBy":"neighbor","matches":"key","any":[{"kind":"property_identifier","regex":"^constructor$"},{"kind":"string","value":{"eq":"constructor"}}]}}},"transform":{"KT":{"substring":{"source":"$K","value":true}}}}},"violation":{"anchor":"capture.K","code":"@typescript-eslint/no-dupe-class-members","message":"Rename or remove one of the class members named '$KT'; the later one overwrites the earlier.","suppress":{"eslint":{"rules":["@typescript-eslint/no-dupe-class-members"]},"oxlint":{"rules":["no-dupe-class-members"]},"biome":{"rules":["lint/suspicious/noDuplicateClassMembers"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-no-duplicate-enum-values",
|
|
4
4
|
"revision": 6,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Give each TypeScript enum member a distinct value; duplicates make members indistinguishable at runtime.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"typescript-eslint-no-empty-function","revision":7,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"typescript-eslint-no-empty-function","revision":7,"mode":"steer","description":"Avoid empty TypeScript functions, methods and arrows; add the missing code or a comment explaining why it is empty.","scope":{"include":["**/*.ts","**/*.tsx","**/*.mts","**/*.cts"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"allow":{"type":"array","items":"string","default":[]}}}},{"id":"shared","define":{"language":"typescript","utils":{"r1":{"any":[{"kind":"identifier"},{"kind":"property_identifier"}]},"r2":{"any":[{"kind":"property_identifier","pattern":"$NAME"},{"kind":"number","pattern":"$NAME"},{"kind":"string","pattern":"$NAME"},{"has":{"any":[{"kind":"string"},{"kind":"number"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}}],"pattern":"$NAME"},"kind":"computed_property_name"}]},"r3":{"all":[{"kind":"method_definition"},{"not":{"has":{"not":{"matches":"r1"},"regex":"^static$"}}},{"has":{"any":[{"kind":"property_identifier","regex":"^constructor$"},{"has":{"kind":"string_fragment","regex":"^constructor$"},"kind":"string"}],"field":"name"}},{"inside":{"kind":"class_body"}}]},"r4":{"any":[{"kind":"function_expression"},{"kind":"function_declaration"}]},"r5":{"has":{"not":{"matches":"r1"},"regex":"^async$"}},"r6":{"any":[{"matches":"r13"},{"regex":"^"}]},"r7":{"not":{"inside":{"any":[{"kind":"pair"},{"kind":"public_field_definition"}],"field":"value","stopBy":{"not":{"kind":"parenthesized_expression"}}}}},"r8":{"has":{"field":"name","kind":"identifier","pattern":"$FID"}},"r9":{"kind":"private_property_identifier","pattern":"$PN"},"r10":{"any":[{"kind":"generator_function"},{"kind":"generator_function_declaration"}]},"r11":{"has":{"not":{"matches":"r1"},"pattern":"$$ST","regex":"^static$"}},"r12":{"follows":{"kind":"decorator","stopBy":{"not":{"kind":"comment"}}}},"r13":{"has":{"not":{"matches":"r1"},"pattern":"$$AS","regex":"^async$"}},"r14":{"any":[{"has":{"pattern":"$$GN","regex":"^\\*$"}},{"regex":"^"}]},"r15":{"all":[{"matches":"r4"},{"not":{"matches":"r5"}}]},"r16":{"has":{"not":{"matches":"r1"},"regex":"^get$"}},"r17":{"has":{"not":{"matches":"r1"},"regex":"^set$"}}}}},{"id":"method","forbid":{"ast":{"language":"typescript","rule":{"kind":"statement_block","regex":"^\\{\\s*\\}","inside":{"field":"body","all":[{"kind":"method_definition"},{"not":{"matches":"r3"}},{"any":[{"matches":"r16"},{"matches":"r17"},{"has":{"regex":"^\\*$"}},{"all":[{"matches":"r5"},{"not":{"has":{"regex":"^\\*$"}}}]},{"$option":"allow","cases":{"[\"methods\"]":[]},"default":[{"all":[{"not":{"matches":"r16"}},{"not":{"matches":"r17"}},{"not":{"has":{"regex":"^\\*$"}}},{"not":{"matches":"r5"}}]}],"spread":true}]},{"any":[{"matches":"r11"},{"kind":"method_definition"}]},{"any":[{"matches":"r13"},{"kind":"method_definition"}]},{"any":[{"has":{"regex":"^\\*$","pattern":"$$GN"}},{"kind":"method_definition"}]},{"any":[{"has":{"regex":"^[gs]et$","not":{"matches":"r1"},"pattern":"$$KW"}},{"has":{"field":"parameters","pattern":"$$KW"}}]},{"any":[{"has":{"field":"name","matches":"r9"}},{"has":{"field":"name","matches":"r2"}},{"regex":"^"}]},{"$option":"allow","cases":{"[\"decoratedFunctions\"]":[{"not":{"$option":"allow","cases":{"[\"overrideMethods\"]":{"has":{"kind":"override_modifier"}}},"default":{"matches":"r12"}}}],"[\"overrideMethods\"]":[{"not":{"$option":"allow","cases":{"[\"overrideMethods\"]":{"has":{"kind":"override_modifier"}}},"default":{"matches":"r12"}}}]},"default":[],"spread":true}]}},"transform":{"STW":{"replace":{"source":"$ST","replace":"^.+$","by":"static "}},"PW":{"replace":{"source":"$PN","replace":"^.+$","by":"private "}},"PNQ":{"replace":{"source":"$PN","replace":"^(.+)$","by":" ${1}"}},"ASW":{"replace":{"source":"$AS","replace":"^.+$","by":"async "}},"GNW":{"replace":{"source":"$GN","replace":"^.+$","by":"generator "}},"NQ":{"replace":{"source":"$NAME","value":true,"replace":"(?s)^(.*)$","by":" '${1}'"}},"KWW":{"replace":{"source":"$KW","replace":"(?s)^\\(.*$","by":"method"}},"KWX":{"replace":{"source":"$KWW","replace":"^([gs])et$","by":"${1}etter"}}}}},"violation":{"anchor":"witness.span","code":"@typescript-eslint/no-empty-function","message":"Add code to this empty $STW$PW$ASW$GNW$KWX$NQ$PNQ, or a comment explaining why it is empty.","suppress":{"eslint":{"rules":["@typescript-eslint/no-empty-function"]},"oxlint":{"rules":["no-empty-function"]},"biome":{"rules":["lint/suspicious/noEmptyBlockStatements"]}}}},{"id":"constructor","forbid":{"ast":{"language":"typescript","rule":{"kind":"statement_block","regex":"^\\{\\s*\\}","inside":{"field":"body","all":[{"matches":"r3"},{"not":{"has":{"field":"parameters","has":{"any":[{"kind":"required_parameter"},{"kind":"optional_parameter"}],"has":{"any":[{"kind":"accessibility_modifier"},{"kind":"override_modifier"},{"regex":"^readonly$","not":{"matches":"r1"}}]}}}}},{"$option":"allow","cases":{"[\"private-constructors\"]":[{"not":{"has":{"kind":"accessibility_modifier","regex":{"$option":"allow","cases":{"[\"protected-constructors\"]":"^protected$"},"default":"^private$"}}}}],"[\"protected-constructors\"]":[{"not":{"has":{"kind":"accessibility_modifier","regex":{"$option":"allow","cases":{"[\"protected-constructors\"]":"^protected$"},"default":"^private$"}}}}]},"default":[],"spread":true}]}},"when":{"option":{"allow":{"in":[[],["methods"],["private-constructors"],["protected-constructors"],["decoratedFunctions"],["overrideMethods"]]}}}}},"violation":{"anchor":"witness.span","code":"@typescript-eslint/no-empty-function","message":"Add code to this empty constructor, or a comment explaining why it is empty.","suppress":{"eslint":{"rules":["@typescript-eslint/no-empty-function"]},"oxlint":{"rules":["no-empty-function"]},"biome":{"rules":["lint/suspicious/noEmptyBlockStatements"]}}}},{"id":"member-function","forbid":{"ast":{"language":"typescript","rule":{"kind":"statement_block","regex":"^\\{\\s*\\}","inside":{"field":"body","all":[{"any":[{"matches":"r15"},{"all":[{"matches":"r4"},{"matches":"r5"}]},{"matches":"r10"},{"kind":"arrow_function"}]},{"matches":"r6"},{"matches":"r14"},{"inside":{"field":"value","stopBy":{"not":{"kind":"parenthesized_expression"}},"any":[{"kind":"pair"},{"kind":"public_field_definition"}],"all":[{"any":[{"matches":"r11"},{"regex":"^"}]},{"any":[{"all":[{"kind":"pair"},{"any":[{"has":{"field":"key","matches":"r9"}},{"has":{"field":"key","matches":"r2"}},{"has":{"field":"value","matches":"r8"}},{"regex":"^"}]}]},{"all":[{"kind":"public_field_definition"},{"any":[{"has":{"field":"name","matches":"r9"}},{"has":{"field":"name","matches":"r2"}},{"has":{"field":"value","matches":"r8"}},{"regex":"^"}]}]}]}]}}]}},"transform":{"STW":{"replace":{"source":"$ST","replace":"^.+$","by":"static "}},"PW":{"replace":{"source":"$PN","replace":"^.+$","by":"private "}},"PNQ":{"replace":{"source":"$PN","replace":"^(.+)$","by":" ${1}"}},"ASW":{"replace":{"source":"$AS","replace":"^.+$","by":"async "}},"GNW":{"replace":{"source":"$GN","replace":"^.+$","by":"generator "}},"NQ":{"replace":{"source":"$NAME","value":true,"replace":"(?s)^(.*)$","by":" '${1}'"}},"FQ":{"replace":{"source":"$FID","replace":"^(.+)$","by":" '${1}'"}}}}},"violation":{"anchor":"witness.span","code":"@typescript-eslint/no-empty-function","message":"Add code to this empty $STW$PW$ASW$GNWmethod$NQ$PNQ$FQ, or a comment explaining why it is empty.","suppress":{"eslint":{"rules":["@typescript-eslint/no-empty-function"]},"oxlint":{"rules":["no-empty-function"]},"biome":{"rules":["lint/suspicious/noEmptyBlockStatements"]}}}},{"id":"function","forbid":{"ast":{"language":"typescript","rule":{"kind":"statement_block","regex":"^\\{\\s*\\}","inside":{"field":"body","all":[{"any":[{"matches":"r15"},{"all":[{"matches":"r4"},{"matches":"r5"}]},{"matches":"r10"}]},{"matches":"r7"},{"matches":"r6"},{"matches":"r14"},{"any":[{"matches":"r8"},{"regex":"^"}]}]}},"transform":{"ASW":{"replace":{"source":"$AS","replace":"^.+$","by":"async "}},"GNW":{"replace":{"source":"$GN","replace":"^.+$","by":"generator "}},"FQ":{"replace":{"source":"$FID","replace":"^(.+)$","by":" '${1}'"}}}}},"violation":{"anchor":"witness.span","code":"@typescript-eslint/no-empty-function","message":"Add code to this empty $ASW$GNWfunction$FQ, or a comment explaining why it is empty.","suppress":{"eslint":{"rules":["@typescript-eslint/no-empty-function"]},"oxlint":{"rules":["no-empty-function"]},"biome":{"rules":["lint/suspicious/noEmptyBlockStatements"]}}}},{"id":"arrow-function","forbid":{"ast":{"language":"typescript","rule":{"kind":"statement_block","regex":"^\\{\\s*\\}","inside":{"field":"body","all":[{"kind":"arrow_function"},{"matches":"r7"},{"matches":"r6"}]}},"transform":{"ASW":{"replace":{"source":"$AS","replace":"^.+$","by":"async "}}}}},"violation":{"anchor":"witness.span","code":"@typescript-eslint/no-empty-function","message":"Add code to this empty $ASWarrow function, or a comment explaining why it is empty.","suppress":{"eslint":{"rules":["@typescript-eslint/no-empty-function"]},"oxlint":{"rules":["no-empty-function"]},"biome":{"rules":["lint/suspicious/noEmptyBlockStatements"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-no-extra-non-null-assertion",
|
|
4
4
|
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove repeated non-null assertions and ones placed before an optional chain; they add nothing.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-no-import-type-side-effects",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use a top-level import type when every imported name is an inline type import; otherwise a side-effect import stays at runtime.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"violation": {
|
|
107
107
|
"anchor": "witness.span",
|
|
108
108
|
"code": "@typescript-eslint/no-import-type-side-effects",
|
|
109
|
-
"message": "
|
|
109
|
+
"message": "Replace the inline `type` qualifiers with one top-level `import type` so the whole import is erased.",
|
|
110
110
|
"suppress": {
|
|
111
111
|
"eslint": {
|
|
112
112
|
"rules": [
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
"violation": {
|
|
234
234
|
"anchor": "witness.span",
|
|
235
235
|
"code": "@typescript-eslint/no-import-type-side-effects",
|
|
236
|
-
"message": "
|
|
236
|
+
"message": "Replace the inline `type` qualifiers with one top-level `import type` so the whole import is erased.",
|
|
237
237
|
"fix": "import type { $A } from $S;",
|
|
238
238
|
"suppress": {
|
|
239
239
|
"eslint": {
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
"violation": {
|
|
356
356
|
"anchor": "witness.span",
|
|
357
357
|
"code": "@typescript-eslint/no-import-type-side-effects",
|
|
358
|
-
"message": "
|
|
358
|
+
"message": "Replace the inline `type` qualifiers with one top-level `import type` so the whole import is erased.",
|
|
359
359
|
"fix": "import type { $A as $B } from $S;",
|
|
360
360
|
"suppress": {
|
|
361
361
|
"eslint": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-no-namespace",
|
|
4
4
|
"revision": 7,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use ES module imports and exports instead of TypeScript namespaces and custom modules; global augmentations, named module declarations and .d.ts files are exempt.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-no-non-null-asserted-optional-chain",
|
|
4
4
|
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Don't put a non-null assertion on an optional chain; the chain can return undefined by design, so the assertion hides a real case.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-no-non-null-assertion",
|
|
4
4
|
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "typescript-eslint-no-unsafe-function-type",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
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":"
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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":"
|
|
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": "
|
|
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",
|