@neralabs/rerail-pack-typescript 0.1.1 → 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 +179 -2
- 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 +7 -4
- 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 +6 -3
- package/rules/typescript-eslint-no-confusing-non-null-assertion.json +9 -6
- package/rules/typescript-eslint-no-dupe-class-members.json +1 -1
- package/rules/typescript-eslint-no-duplicate-enum-values.json +3 -7
- package/rules/typescript-eslint-no-empty-function.json +1 -1
- package/rules/typescript-eslint-no-extra-non-null-assertion.json +6 -3
- package/rules/typescript-eslint-no-import-type-side-effects.json +9 -6
- package/rules/typescript-eslint-no-namespace.json +3 -7
- package/rules/typescript-eslint-no-non-null-asserted-optional-chain.json +6 -3
- package/rules/typescript-eslint-no-non-null-assertion.json +5 -9
- package/rules/typescript-eslint-no-unnecessary-type-constraint.json +6 -3
- package/rules/typescript-eslint-no-unsafe-function-type.json +3 -7
- 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 +3 -7
- 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 +6 -3
- package/rules/typescript-eslint-no-wrapper-object-types.json +0 -628
package/pack.json
CHANGED
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
"id": "typescript",
|
|
4
4
|
"name": "TypeScript",
|
|
5
5
|
"category": "language",
|
|
6
|
-
"covers": "
|
|
6
|
+
"covers": "21 typescript-eslint rules ported to Rerail, 10 of them on and 11 off until turned on, each scored against the tool's own recorded findings on its test fixtures.",
|
|
7
7
|
"reason": "matches TypeScript",
|
|
8
8
|
"match": {
|
|
9
9
|
"any": [
|
|
10
10
|
{
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"ecosystem": "npm",
|
|
13
|
+
"names": [
|
|
14
|
+
"typescript"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
14
17
|
},
|
|
15
18
|
{
|
|
16
19
|
"files": [
|
|
@@ -153,12 +156,6 @@
|
|
|
153
156
|
"group": "typescript-eslint",
|
|
154
157
|
"on": false
|
|
155
158
|
},
|
|
156
|
-
{
|
|
157
|
-
"id": "typescript-eslint-no-wrapper-object-types",
|
|
158
|
-
"document": "rules/typescript-eslint-no-wrapper-object-types.json",
|
|
159
|
-
"title": "typescript-eslint no-wrapper-object-types: Disallow using confusing built-in primitive class wrappers",
|
|
160
|
-
"group": "typescript-eslint"
|
|
161
|
-
},
|
|
162
159
|
{
|
|
163
160
|
"id": "typescript-eslint-prefer-as-const",
|
|
164
161
|
"document": "rules/typescript-eslint-prefer-as-const.json",
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-ban-tslint-comment",
|
|
4
|
-
"revision":
|
|
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",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -25,7 +28,7 @@
|
|
|
25
28
|
"violation": {
|
|
26
29
|
"anchor": "witness.span",
|
|
27
30
|
"code": "@typescript-eslint/ban-tslint-comment",
|
|
28
|
-
"message": "
|
|
31
|
+
"message": "Delete the \"$TEXT\" comment; TSLint is deprecated and nothing reads it.",
|
|
29
32
|
"fix": "",
|
|
30
33
|
"suppress": {
|
|
31
34
|
"eslint": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"typescript-eslint-consistent-type-definitions","revision":
|
|
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"]}}}}]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-default-param-last",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
7
|
-
"scope": { "include": ["
|
|
6
|
+
"description": "Put defaulted and optional parameters after required ones in TypeScript functions; callers otherwise can't omit them.",
|
|
7
|
+
"scope": { "include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"], "exclude": [] },
|
|
8
8
|
"clauses": [
|
|
9
9
|
{
|
|
10
10
|
"id": "default-param-not-last",
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-array-constructor",
|
|
4
|
-
"revision":
|
|
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",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-confusing-non-null-assertion",
|
|
4
|
-
"revision":
|
|
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",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -66,7 +69,7 @@
|
|
|
66
69
|
"violation": {
|
|
67
70
|
"anchor": "witness.span",
|
|
68
71
|
"code": "@typescript-eslint/no-confusing-non-null-assertion",
|
|
69
|
-
"message": "
|
|
72
|
+
"message": "Wrap the asserted left side in parentheses, `(a!) = b`, so it can't be read as `a != b`.",
|
|
70
73
|
"suppress": {
|
|
71
74
|
"eslint": {
|
|
72
75
|
"rules": [
|
|
@@ -136,7 +139,7 @@
|
|
|
136
139
|
"violation": {
|
|
137
140
|
"anchor": "witness.span",
|
|
138
141
|
"code": "@typescript-eslint/no-confusing-non-null-assertion",
|
|
139
|
-
"message": "
|
|
142
|
+
"message": "Wrap the asserted left side in parentheses, `(a!) == b`, so it can't be read as `a !== b`.",
|
|
140
143
|
"suppress": {
|
|
141
144
|
"eslint": {
|
|
142
145
|
"rules": [
|
|
@@ -207,7 +210,7 @@
|
|
|
207
210
|
"violation": {
|
|
208
211
|
"anchor": "witness.span",
|
|
209
212
|
"code": "@typescript-eslint/no-confusing-non-null-assertion",
|
|
210
|
-
"message": "
|
|
213
|
+
"message": "Wrap the asserted left side in parentheses, `(a!) $OP b`, so it can't be read as `!(a $OP b)`.",
|
|
211
214
|
"suppress": {
|
|
212
215
|
"eslint": {
|
|
213
216
|
"rules": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"typescript-eslint-no-dupe-class-members","revision":
|
|
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"]}}}}]}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-duplicate-enum-values",
|
|
4
|
-
"revision":
|
|
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",
|
|
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
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"typescript-eslint-no-empty-function","revision":
|
|
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"]}}}}]}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-extra-non-null-assertion",
|
|
4
|
-
"revision":
|
|
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",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-import-type-side-effects",
|
|
4
|
-
"revision":
|
|
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",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -103,7 +106,7 @@
|
|
|
103
106
|
"violation": {
|
|
104
107
|
"anchor": "witness.span",
|
|
105
108
|
"code": "@typescript-eslint/no-import-type-side-effects",
|
|
106
|
-
"message": "
|
|
109
|
+
"message": "Replace the inline `type` qualifiers with one top-level `import type` so the whole import is erased.",
|
|
107
110
|
"suppress": {
|
|
108
111
|
"eslint": {
|
|
109
112
|
"rules": [
|
|
@@ -230,7 +233,7 @@
|
|
|
230
233
|
"violation": {
|
|
231
234
|
"anchor": "witness.span",
|
|
232
235
|
"code": "@typescript-eslint/no-import-type-side-effects",
|
|
233
|
-
"message": "
|
|
236
|
+
"message": "Replace the inline `type` qualifiers with one top-level `import type` so the whole import is erased.",
|
|
234
237
|
"fix": "import type { $A } from $S;",
|
|
235
238
|
"suppress": {
|
|
236
239
|
"eslint": {
|
|
@@ -352,7 +355,7 @@
|
|
|
352
355
|
"violation": {
|
|
353
356
|
"anchor": "witness.span",
|
|
354
357
|
"code": "@typescript-eslint/no-import-type-side-effects",
|
|
355
|
-
"message": "
|
|
358
|
+
"message": "Replace the inline `type` qualifiers with one top-level `import type` so the whole import is erased.",
|
|
356
359
|
"fix": "import type { $A as $B } from $S;",
|
|
357
360
|
"suppress": {
|
|
358
361
|
"eslint": {
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "typescript-eslint-no-namespace",
|
|
4
|
-
"revision":
|
|
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",
|
|
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
|
},
|
|
@@ -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
|
-
"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",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -1,19 +1,15 @@
|
|
|
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
|
-
"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",
|
|
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
|
},
|
|
@@ -87,7 +83,7 @@
|
|
|
87
83
|
"violation": {
|
|
88
84
|
"anchor": "witness.span",
|
|
89
85
|
"code": "@typescript-eslint/no-non-null-assertion",
|
|
90
|
-
"message": "
|
|
86
|
+
"message": "Replace this ! assertion with an explicit null or undefined check, or with optional chaining.",
|
|
91
87
|
"suppress": {
|
|
92
88
|
"eslint": {
|
|
93
89
|
"rules": [
|
|
@@ -191,7 +187,7 @@
|
|
|
191
187
|
"violation": {
|
|
192
188
|
"anchor": "capture.START",
|
|
193
189
|
"code": "@typescript-eslint/no-non-null-assertion",
|
|
194
|
-
"message": "
|
|
190
|
+
"message": "Replace this ! assertion with an explicit null or undefined check, or with optional chaining.",
|
|
195
191
|
"suppress": {
|
|
196
192
|
"eslint": {
|
|
197
193
|
"rules": [
|
|
@@ -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
|
-
"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",
|
|
10
|
+
"**/*.tsx",
|
|
11
|
+
"**/*.mts",
|
|
12
|
+
"**/*.cts"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -1,19 +1,15 @@
|
|
|
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
|
-
"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",
|
|
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
|
},
|
|
@@ -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":"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"]}}}}]}
|
|
@@ -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
|
-
"description": "
|
|
7
|
-
"scope": { "include": ["
|
|
6
|
+
"description": "Remove export {} from TypeScript files that already import or export something; the file is a module already.",
|
|
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",
|