@neralabs/rerail-pack-javascript 0.1.1
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/LICENSE +202 -0
- package/NOTICE +7 -0
- package/README.md +37 -0
- package/licenses/eslint/LICENSE +19 -0
- package/licenses/eslint/UPSTREAM.md +10363 -0
- package/licenses/eslint-plugin-unicorn/LICENSE +9 -0
- package/licenses/eslint-plugin-unicorn/UPSTREAM.md +297 -0
- package/pack.json +499 -0
- package/package.json +30 -0
- package/rules/eslint-arrow-body-style.json +1 -0
- package/rules/eslint-capitalized-comments.json +1 -0
- package/rules/eslint-default-case-last.json +52 -0
- package/rules/eslint-default-case.json +1 -0
- package/rules/eslint-eqeqeq.json +608 -0
- package/rules/eslint-func-style.json +1 -0
- package/rules/eslint-guard-for-in.json +144 -0
- package/rules/eslint-no-bitwise.json +1 -0
- package/rules/eslint-no-caller.json +63 -0
- package/rules/eslint-no-case-declarations.json +101 -0
- package/rules/eslint-no-compare-neg-zero.json +109 -0
- package/rules/eslint-no-cond-assign.json +1 -0
- package/rules/eslint-no-console.json +1 -0
- package/rules/eslint-no-continue.json +48 -0
- package/rules/eslint-no-debugger.json +55 -0
- package/rules/eslint-no-delete-var.json +63 -0
- package/rules/eslint-no-div-regex.json +1 -0
- package/rules/eslint-no-dupe-keys.json +295 -0
- package/rules/eslint-no-duplicate-case.json +160 -0
- package/rules/eslint-no-empty-pattern.json +1 -0
- package/rules/eslint-no-empty-static-block.json +64 -0
- package/rules/eslint-no-empty.json +187 -0
- package/rules/eslint-no-eq-null.json +65 -0
- package/rules/eslint-no-extend-native.json +1 -0
- package/rules/eslint-no-inline-comments.json +1 -0
- package/rules/eslint-no-iterator.json +1 -0
- package/rules/eslint-no-loss-of-precision.json +1 -0
- package/rules/eslint-no-multi-str.json +61 -0
- package/rules/eslint-no-negated-condition.json +114 -0
- package/rules/eslint-no-nested-ternary.json +76 -0
- package/rules/eslint-no-new-wrappers.json +89 -0
- package/rules/eslint-no-new.json +56 -0
- package/rules/eslint-no-nonoctal-decimal-escape.json +54 -0
- package/rules/eslint-no-octal-escape.json +1 -0
- package/rules/eslint-no-octal.json +15 -0
- package/rules/eslint-no-plusplus.json +1 -0
- package/rules/eslint-no-proto.json +1 -0
- package/rules/eslint-no-prototype-builtins.json +143 -0
- package/rules/eslint-no-return-assign.json +1 -0
- package/rules/eslint-no-script-url.json +81 -0
- package/rules/eslint-no-self-compare.json +121 -0
- package/rules/eslint-no-setter-return.json +1 -0
- package/rules/eslint-no-sparse-arrays.json +59 -0
- package/rules/eslint-no-template-curly-in-string.json +58 -0
- package/rules/eslint-no-ternary.json +48 -0
- package/rules/eslint-no-unneeded-ternary.json +1 -0
- package/rules/eslint-no-unsafe-finally.json +570 -0
- package/rules/eslint-no-unsafe-negation.json +1 -0
- package/rules/eslint-no-useless-call.json +1 -0
- package/rules/eslint-no-useless-catch.json +239 -0
- package/rules/eslint-no-useless-concat.json +1 -0
- package/rules/eslint-no-void.json +1 -0
- package/rules/eslint-no-warning-comments.json +1 -0
- package/rules/eslint-no-with.json +51 -0
- package/rules/eslint-operator-assignment.json +1 -0
- package/rules/eslint-prefer-numeric-literals.json +1 -0
- package/rules/eslint-prefer-spread.json +1 -0
- package/rules/eslint-prefer-template.json +187 -0
- package/rules/eslint-radix.json +533 -0
- package/rules/eslint-sort-imports.json +1 -0
- package/rules/eslint-sort-keys.json +1 -0
- package/rules/eslint-sort-vars.json +1 -0
- package/rules/eslint-use-isnan.json +400 -0
- package/rules/eslint-valid-typeof.json +1 -0
- package/rules/eslint-yoda.json +1 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "rerail.policy/v1",
|
|
3
|
+
"id": "eslint-no-useless-catch",
|
|
4
|
+
"revision": 3,
|
|
5
|
+
"mode": "steer",
|
|
6
|
+
"description": "Port of ESLint's `no-useless-catch` rule (https://eslint.org/docs/latest/rules/no-useless-catch). Flags a catch clause whose first statement rethrows its own identifier parameter: the whole try statement when there is no finally block, else the catch clause.",
|
|
7
|
+
"scope": {
|
|
8
|
+
"include": [
|
|
9
|
+
"**/*"
|
|
10
|
+
],
|
|
11
|
+
"exclude": []
|
|
12
|
+
},
|
|
13
|
+
"clauses": [
|
|
14
|
+
{
|
|
15
|
+
"id": "unnecessary-catch",
|
|
16
|
+
"forbid": {
|
|
17
|
+
"ast": {
|
|
18
|
+
"language": "typescript",
|
|
19
|
+
"rule": {
|
|
20
|
+
"all": [
|
|
21
|
+
{
|
|
22
|
+
"kind": "try_statement"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"not": {
|
|
26
|
+
"has": {
|
|
27
|
+
"kind": "finally_clause"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"has": {
|
|
33
|
+
"matches": "useless-catch"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"utils": {
|
|
39
|
+
"useless-catch": {
|
|
40
|
+
"all": [
|
|
41
|
+
{
|
|
42
|
+
"kind": "catch_clause"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"has": {
|
|
46
|
+
"kind": "identifier",
|
|
47
|
+
"pattern": "$P"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"has": {
|
|
52
|
+
"kind": "statement_block",
|
|
53
|
+
"has": {
|
|
54
|
+
"all": [
|
|
55
|
+
{
|
|
56
|
+
"kind": "throw_statement"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"not": {
|
|
60
|
+
"follows": {
|
|
61
|
+
"all": [
|
|
62
|
+
{
|
|
63
|
+
"not": {
|
|
64
|
+
"kind": "comment"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"not": {
|
|
69
|
+
"regex": "^\\{$"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"stopBy": "end"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"has": {
|
|
79
|
+
"matches": "param-ref"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"param-ref": {
|
|
89
|
+
"any": [
|
|
90
|
+
{
|
|
91
|
+
"kind": "identifier",
|
|
92
|
+
"pattern": "$P"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"kind": "parenthesized_expression",
|
|
96
|
+
"has": {
|
|
97
|
+
"matches": "param-ref"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"violation": {
|
|
106
|
+
"anchor": "witness.span",
|
|
107
|
+
"code": "no-useless-catch",
|
|
108
|
+
"message": "Unnecessary try/catch wrapper.",
|
|
109
|
+
"suppress": {
|
|
110
|
+
"eslint": {
|
|
111
|
+
"rules": [
|
|
112
|
+
"no-useless-catch"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"oxlint": {
|
|
116
|
+
"rules": [
|
|
117
|
+
"no-useless-catch"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"biome": {
|
|
121
|
+
"rules": [
|
|
122
|
+
"lint/complexity/noUselessCatch"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "unnecessary-catch-clause",
|
|
130
|
+
"forbid": {
|
|
131
|
+
"ast": {
|
|
132
|
+
"language": "typescript",
|
|
133
|
+
"rule": {
|
|
134
|
+
"all": [
|
|
135
|
+
{
|
|
136
|
+
"matches": "useless-catch"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"inside": {
|
|
140
|
+
"kind": "try_statement",
|
|
141
|
+
"has": {
|
|
142
|
+
"kind": "finally_clause"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"utils": {
|
|
149
|
+
"useless-catch": {
|
|
150
|
+
"all": [
|
|
151
|
+
{
|
|
152
|
+
"kind": "catch_clause"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"has": {
|
|
156
|
+
"kind": "identifier",
|
|
157
|
+
"pattern": "$P"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"has": {
|
|
162
|
+
"kind": "statement_block",
|
|
163
|
+
"has": {
|
|
164
|
+
"all": [
|
|
165
|
+
{
|
|
166
|
+
"kind": "throw_statement"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"not": {
|
|
170
|
+
"follows": {
|
|
171
|
+
"all": [
|
|
172
|
+
{
|
|
173
|
+
"not": {
|
|
174
|
+
"kind": "comment"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"not": {
|
|
179
|
+
"regex": "^\\{$"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"stopBy": "end"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"has": {
|
|
189
|
+
"matches": "param-ref"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"param-ref": {
|
|
199
|
+
"any": [
|
|
200
|
+
{
|
|
201
|
+
"kind": "identifier",
|
|
202
|
+
"pattern": "$P"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"kind": "parenthesized_expression",
|
|
206
|
+
"has": {
|
|
207
|
+
"matches": "param-ref"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"violation": {
|
|
216
|
+
"anchor": "witness.span",
|
|
217
|
+
"code": "no-useless-catch",
|
|
218
|
+
"message": "Unnecessary catch clause.",
|
|
219
|
+
"suppress": {
|
|
220
|
+
"eslint": {
|
|
221
|
+
"rules": [
|
|
222
|
+
"no-useless-catch"
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
"oxlint": {
|
|
226
|
+
"rules": [
|
|
227
|
+
"no-useless-catch"
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"biome": {
|
|
231
|
+
"rules": [
|
|
232
|
+
"lint/complexity/noUselessCatch"
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-useless-concat","revision":4,"mode":"steer","description":"Port of ESLint's `no-useless-concat` rule (https://eslint.org/docs/latest/rules/no-useless-concat). Flags a `+` whose nearest operands (through nested `+` chains and parentheses) are both string or template literals, the right one starting on the line where the left one ends (a `layout` gap to the left literal).","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"literal-concat","forbid":{"ast":{"language":"typescript","rule":{"regex":"^\\+$","inside":{"kind":"binary_expression","stopBy":"neighbor"},"follows":{"matches":"right-most-literal","stopBy":{"not":{"kind":"comment"}}},"precedes":{"matches":"left-most-literal","stopBy":{"not":{"kind":"comment"}}}},"utils":{"right-most-literal":{"any":[{"any":[{"kind":"string"},{"kind":"template_string"}],"pattern":"$L"},{"kind":"parenthesized_expression","has":{"matches":"right-most-literal","stopBy":"neighbor"}},{"kind":"binary_expression","all":[{"has":{"regex":"^\\+$","stopBy":"neighbor"}},{"has":{"matches":"right-most-literal","stopBy":"neighbor","not":{"precedes":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}]}]},"left-most-literal":{"any":[{"any":[{"kind":"string"},{"kind":"template_string"}],"layout":{"before":{"to":"capture.L","breaks":{"eq":0}}}},{"kind":"parenthesized_expression","has":{"matches":"left-most-literal","stopBy":"neighbor"}},{"kind":"binary_expression","all":[{"has":{"regex":"^\\+$","stopBy":"neighbor"}},{"has":{"matches":"left-most-literal","stopBy":"neighbor","not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}]}]}}}},"violation":{"anchor":"witness.span","code":"no-useless-concat","message":"Unexpected string concatenation of literals.","suppress":{"eslint":{"rules":["no-useless-concat"]},"oxlint":{"rules":["no-useless-concat"]},"biome":{"rules":["lint/complexity/noUselessStringConcat"]}}}}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-void","revision":4,"mode":"steer","description":"Port of ESLint's `no-void` rule. Disallows the void operator. Options are declared in the `options` define (the rule's defaults); a variant is a config patch.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"allowAsStatement":{"type":"boolean","nullable":true,"default":null}}}},{"id":"void-operator","forbid":{"ast":{"language":"typescript","rule":{"$option":"allowAsStatement","cases":{"true":{"kind":"unary_expression","has":{"regex":"^void$","stopBy":"neighbor"},"not":{"inside":{"kind":"expression_statement","stopBy":{"not":{"kind":"parenthesized_expression"}}}}}},"default":{"kind":"unary_expression","has":{"regex":"^void$","stopBy":"neighbor"}}}}},"violation":{"anchor":"witness.span","code":"no-void","message":"Expected 'undefined' and instead saw 'void'.","suppress":{"eslint":{"rules":["no-void"]},"oxlint":{"rules":["no-void"]},"biome":{"rules":["lint/complexity/noVoid"]}}}}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-warning-comments","revision":4,"mode":"steer","description":"Port of ESLint's `no-warning-comments` rule (https://eslint.org/docs/latest/rules/no-warning-comments): comments starting with `todo`, `fixme` or `xxx` (case-insensitive, whole word). One finding per matching term. Options are declared in the `options` define (the rule's defaults); a variant is a config patch.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"location":{"type":"string","nullable":true,"default":null},"terms":{"type":"array","items":"string","nullable":true,"default":null},"decoration":{"type":"array","items":"string","nullable":true,"default":null}}}},{"id":"shared","define":{"language":"typescript","utils":{"r1":{"regex":"^(?:/\\*\\s*(?:eslint[- ]|(?:globals?|exported) )|//\\s*eslint-)(?s:.*)(?-u:\\b)no-warning-comments(?-u:\\b)"}}}},{"id":"warning-term-0","forbid":{"ast":{"language":"typescript","rule":{"kind":"comment","regex":{"$option":"decoration","cases":{"[\"*\",\"/\"]":"^(?://|/\\*)[\\s\\*/]*(?i:todo)(?-u:\\b)","[\"*\"]":{"$option":"location","cases":{"start":"^(?://|/\\*)[\\s\\*]*(?i:\\*todo)(?-u:\\b)"},"default":"^(?://|/\\*)[\\s\\*]*(?i:todo)(?-u:\\b)"}},"default":{"$option":"terms","cases":{"[\"fixme\"]":{"$option":"location","cases":{"anywhere":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:fixme)(?-u:\\b)"},"default":"^(?://|/\\*)[\\s]*(?i:fixme)(?-u:\\b)"},"[\"FIXME\"]":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:FIXME)(?-u:\\b)","[\"fixme\",\"todo\"]":{"$option":"location","cases":{"anywhere":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:fixme)(?-u:\\b)"},"default":"^(?://|/\\*)[\\s]*(?i:fixme)(?-u:\\b)"},"[\"todo!\"]":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:todo!)","[\"!todo\"]":"^(?://|/\\*)(?s:.*?)(?i:!todo)(?-u:\\b)","[\"[aeiou]\"]":"^(?://|/\\*)(?s:.*?)(?i:\\[aeiou\\])","[\"foo-bar\"]":"^(?://|/\\*)[\\s]*(?i:foo\\-bar)(?-u:\\b)","[\"[litera|$]\"]":"^(?://|/\\*)(?s:.*?)(?i:\\[litera\\|\\$\\])","[\"eslint\"]":"^(?://|/\\*)[\\s]*(?i:eslint)(?-u:\\b)","[\"one\"]":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:one)(?-u:\\b)","[\"FIX!\"]":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:FIX!)","[\"!FIX\"]":"^(?://|/\\*)(?s:.*?)(?i:!FIX)(?-u:\\b)","[\"!xxx\"]":{"$option":"location","cases":{"start":"^(?://|/\\*)[\\s]*(?i:!xxx)(?-u:\\b)"},"default":"^(?://|/\\*)(?s:.*?)(?i:!xxx)(?-u:\\b)"}},"default":{"$option":"location","cases":{"anywhere":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:todo)(?-u:\\b)"},"default":"^(?://|/\\*)[\\s]*(?i:todo)(?-u:\\b)"}}},"not":{"matches":"r1"},"pattern":"$C"},"transform":{"C1":{"replace":{"source":"$C","replace":"(?s)^(?://(.*)|/\\*(.*)\\*/)$","by":"${1}${2}"}},"C2":{"replace":{"source":"$C1","replace":"^\\s+|\\s+$","by":""}},"C3":{"replace":{"source":"$C2","replace":"\\s+","by":" "}},"C4":{"replace":{"source":"$C3","replace":"(?s)^(.{41,})$","by":"\u0001${1}"}},"C5":{"replace":{"source":"$C4","replace":"(?s)^\u0001(.{0,40}) .*$","by":"${1}..."}},"CT":{"replace":{"source":"$C5","replace":"(?s)^\u0001.*$","by":"..."}}}}},"violation":{"anchor":"witness.span","code":"no-warning-comments","message":{"$option":"terms","cases":{"[\"fixme\"]":"Unexpected 'fixme' comment: '$CT'.","[\"FIXME\"]":"Unexpected 'FIXME' comment: '$CT'.","[\"fixme\",\"todo\"]":"Unexpected 'fixme' comment: '$CT'.","[\"todo!\"]":"Unexpected 'todo!' comment: '$CT'.","[\"!todo\"]":"Unexpected '!todo' comment: '$CT'.","[\"[aeiou]\"]":"Unexpected '[aeiou]' comment: '$CT'.","[\"foo-bar\"]":"Unexpected 'foo-bar' comment: '$CT'.","[\"[litera|$]\"]":"Unexpected '[litera|$]' comment: '$CT'.","[\"eslint\"]":"Unexpected 'eslint' comment: '$CT'.","[\"one\"]":"Unexpected 'one' comment: '$CT'.","[\"FIX!\"]":"Unexpected 'FIX!' comment: '$CT'.","[\"!FIX\"]":"Unexpected '!FIX' comment: '$CT'.","[\"!xxx\"]":"Unexpected '!xxx' comment: '$CT'.","[\"*todo\"]":"Unexpected '*todo' comment: '$CT'."},"default":"Unexpected 'todo' comment: '$CT'."},"suppress":{"eslint":{"rules":["no-warning-comments"]},"oxlint":{"rules":["no-warning-comments"]}}}},{"id":"warning-term-1","forbid":{"ast":{"language":"typescript","rule":{"kind":"comment","regex":{"$option":"decoration","cases":{"[\"*\"]":"^(?://|/\\*)[\\s\\*]*(?i:fixme)(?-u:\\b)"},"default":{"$option":"terms","cases":{"[\"fixme\",\"todo\"]":{"$option":"location","cases":{"anywhere":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:todo)(?-u:\\b)"},"default":"^(?://|/\\*)[\\s]*(?i:todo)(?-u:\\b)"}},"default":{"$option":"location","cases":{"anywhere":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:fixme)(?-u:\\b)"},"default":"^(?://|/\\*)[\\s]*(?i:fixme)(?-u:\\b)"}}},"not":{"matches":"r1"},"pattern":"$C"},"transform":{"C1":{"replace":{"source":"$C","replace":"(?s)^(?://(.*)|/\\*(.*)\\*/)$","by":"${1}${2}"}},"C2":{"replace":{"source":"$C1","replace":"^\\s+|\\s+$","by":""}},"C3":{"replace":{"source":"$C2","replace":"\\s+","by":" "}},"C4":{"replace":{"source":"$C3","replace":"(?s)^(.{41,})$","by":"\u0001${1}"}},"C5":{"replace":{"source":"$C4","replace":"(?s)^\u0001(.{0,40}) .*$","by":"${1}..."}},"CT":{"replace":{"source":"$C5","replace":"(?s)^\u0001.*$","by":"..."}}},"when":{"option":{"terms":{"in":[null,["fixme","todo"]]}}}}},"violation":{"anchor":"witness.span","code":"no-warning-comments","message":{"$option":"terms","cases":{"[\"fixme\",\"todo\"]":"Unexpected 'todo' comment: '$CT'."},"default":"Unexpected 'fixme' comment: '$CT'."},"suppress":{"eslint":{"rules":["no-warning-comments"]},"oxlint":{"rules":["no-warning-comments"]}}}},{"id":"warning-term-2","forbid":{"ast":{"language":"typescript","rule":{"kind":"comment","regex":{"$option":"location","cases":{"anywhere":"^(?://|/\\*)(?s:.*?)(?-u:\\b)(?i:xxx)(?-u:\\b)"},"default":{"$option":"decoration","cases":{"[\"*\"]":"^(?://|/\\*)[\\s\\*]*(?i:xxx)(?-u:\\b)"},"default":"^(?://|/\\*)[\\s]*(?i:xxx)(?-u:\\b)"}},"not":{"matches":"r1"},"pattern":"$C"},"transform":{"C1":{"replace":{"source":"$C","replace":"(?s)^(?://(.*)|/\\*(.*)\\*/)$","by":"${1}${2}"}},"C2":{"replace":{"source":"$C1","replace":"^\\s+|\\s+$","by":""}},"C3":{"replace":{"source":"$C2","replace":"\\s+","by":" "}},"C4":{"replace":{"source":"$C3","replace":"(?s)^(.{41,})$","by":"\u0001${1}"}},"C5":{"replace":{"source":"$C4","replace":"(?s)^\u0001(.{0,40}) .*$","by":"${1}..."}},"CT":{"replace":{"source":"$C5","replace":"(?s)^\u0001.*$","by":"..."}}},"when":{"option":{"terms":null}}}},"violation":{"anchor":"witness.span","code":"no-warning-comments","message":"Unexpected 'xxx' comment: '$CT'.","suppress":{"eslint":{"rules":["no-warning-comments"]},"oxlint":{"rules":["no-warning-comments"]}}}}]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "rerail.policy/v1",
|
|
3
|
+
"id": "eslint-no-with",
|
|
4
|
+
"revision": 3,
|
|
5
|
+
"mode": "steer",
|
|
6
|
+
"description": "Port of ESLint's `no-with` rule (https://eslint.org/docs/latest/rules/no-with). Reports every `with` statement, at its `with` keyword.",
|
|
7
|
+
"scope": {
|
|
8
|
+
"include": [
|
|
9
|
+
"**/*"
|
|
10
|
+
],
|
|
11
|
+
"exclude": []
|
|
12
|
+
},
|
|
13
|
+
"clauses": [
|
|
14
|
+
{
|
|
15
|
+
"id": "with-statement",
|
|
16
|
+
"forbid": {
|
|
17
|
+
"ast": {
|
|
18
|
+
"language": "typescript",
|
|
19
|
+
"rule": {
|
|
20
|
+
"regex": "^with$",
|
|
21
|
+
"inside": {
|
|
22
|
+
"kind": "with_statement"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"violation": {
|
|
28
|
+
"anchor": "witness.span",
|
|
29
|
+
"code": "no-with",
|
|
30
|
+
"message": "Unexpected use of 'with' statement.",
|
|
31
|
+
"suppress": {
|
|
32
|
+
"eslint": {
|
|
33
|
+
"rules": [
|
|
34
|
+
"no-with"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"oxlint": {
|
|
38
|
+
"rules": [
|
|
39
|
+
"no-with"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"biome": {
|
|
43
|
+
"rules": [
|
|
44
|
+
"lint/suspicious/noWith"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-operator-assignment","revision":6,"mode":"steer","description":"Port of ESLint's `operator-assignment` rule (https://eslint.org/docs/latest/rules/operator-assignment). Default option `always`: flags `x = x op y` where op has a shorthand; references are compared as ESLint's `isSameReference` without static computed keys (`compare` text `reference-no-static-keys`), the operator's left operand first, then its right for a commutative operator; ESLint's `canBeFixed` gates the fix. Options are declared in the `options` define (the rule's defaults); a variant is a config patch.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"option":{"type":"string","nullable":true,"default":null}}}},{"id":"shared","define":{"language":"typescript","utils":{"fixable":{"any":[{"kind":"identifier"},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","not":{"kind":"comment"},"matches":"fixable"}},{"kind":"member_expression","has":{"stopBy":"neighbor","matches":"plain","precedes":{"stopBy":"neighbor","regex":"^\\.$"}}},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","matches":"plain","precedes":{"stopBy":"neighbor","regex":"^\\[$"}}},{"has":{"stopBy":"neighbor","follows":{"stopBy":"neighbor","regex":"^\\[$"},"matches":"literal"}}]}]},"literal":{"any":[{"kind":"string"},{"kind":"number"},{"kind":"true"},{"kind":"false"},{"kind":"null"},{"kind":"regex"},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","not":{"kind":"comment"},"matches":"literal"}}]},"plain":{"any":[{"kind":"identifier"},{"kind":"this"},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","not":{"kind":"comment"},"matches":"plain"}}]},"r1":{"has":{"all":[{"has":{"not":{"kind":"comment"},"pattern":"$B","precedes":{"pattern":"$$OP","regex":"^(?:\\*|&|\\^|\\||\\+|-|/|%|<<|>>|>>>|\\*\\*)$","stopBy":"end"},"stopBy":"neighbor"}},{"has":{"follows":{"regex":"^(?:\\*|&|\\^|\\||\\+|-|/|%|<<|>>|>>>|\\*\\*)$","stopBy":"end"},"not":{"kind":"comment"},"pattern":"$BR","stopBy":"neighbor"}}],"kind":"binary_expression","stopBy":{"not":{"kind":"parenthesized_expression"}}}},"r2":{"all":[{"has":{"matches":"fixable","pattern":"$L","precedes":{"regex":"^=$","stopBy":"end"},"stopBy":"neighbor"}},{"has":{"has":{"matches":"fixable","not":{"kind":"comment"},"pattern":"$B","stopBy":"neighbor"},"kind":"binary_expression","stopBy":{"not":{"kind":"parenthesized_expression"}}}},{"not":{"has":{"kind":"comment","stopBy":"end"}}}]},"r3":{"has":{"not":{"kind":"comment"},"pattern":"$L","precedes":{"regex":"^=$","stopBy":"end"},"stopBy":"neighbor"}},"r4":{"compare":{"left":"L","op":"eq","right":"B","text":"reference-no-static-keys"}}}}},{"id":"replaceable-fix","forbid":{"ast":{"language":"typescript","rule":{"kind":"assignment_expression","all":[{"matches":"r3"},{"matches":"r1"},{"matches":"r4"},{"matches":"r2"}]},"when":{"option":{"option":{"in":[null,"always"]}}}}},"violation":{"anchor":"witness.span","code":"operator-assignment","message":"Assignment (=) can be replaced with operator assignment ($OP=).","fix":"$L $OP= $BR","suppress":{"eslint":{"rules":["operator-assignment"]},"oxlint":{"rules":["operator-assignment"]},"biome":{"rules":["lint/style/useShorthandAssign"]}}}},{"id":"replaceable","forbid":{"ast":{"language":"typescript","rule":{"kind":"assignment_expression","all":[{"matches":"r3"},{"matches":"r1"},{"matches":"r4"},{"not":{"matches":"r2"}}]},"when":{"option":{"option":{"in":[null,"always"]}}}}},"violation":{"anchor":"witness.span","code":"operator-assignment","message":"Assignment (=) can be replaced with operator assignment ($OP=).","suppress":{"eslint":{"rules":["operator-assignment"]},"oxlint":{"rules":["operator-assignment"]},"biome":{"rules":["lint/style/useShorthandAssign"]}}}},{"id":"replaceable-commutative","forbid":{"ast":{"language":"typescript","rule":{"kind":"assignment_expression","all":[{"matches":"r3"},{"has":{"stopBy":{"not":{"kind":"parenthesized_expression"}},"kind":"binary_expression","all":[{"has":{"stopBy":"neighbor","not":{"kind":"comment"},"pattern":"$B","precedes":{"stopBy":"end","regex":"^(?:\\*|&|\\^|\\|)$","pattern":"$$OP"}}},{"has":{"stopBy":"neighbor","not":{"kind":"comment"},"pattern":"$BR","follows":{"stopBy":"end","regex":"^(?:\\*|&|\\^|\\|)$"}}}]}},{"not":{"matches":"r4"}},{"compare":{"left":"L","op":"eq","right":"BR","text":"reference-no-static-keys"}}]},"when":{"option":{"option":{"in":[null,"always"]}}}}},"violation":{"anchor":"witness.span","code":"operator-assignment","message":"Assignment (=) can be replaced with operator assignment ($OP=).","suppress":{"eslint":{"rules":["operator-assignment"]},"oxlint":{"rules":["operator-assignment"]},"biome":{"rules":["lint/style/useShorthandAssign"]}}}},{"id":"shorthand","forbid":{"ast":{"language":"typescript","rule":{"kind":"augmented_assignment_expression","has":{"stopBy":"neighbor","pattern":"$$OP","regex":"^(?:\\+|-|\\*|/|%|<<|>>|>>>|\\*\\*|&|\\^|\\|)=$"}},"when":{"option":{"option":"never"}}}},"violation":{"anchor":"witness.span","code":"operator-assignment","message":"Unexpected operator assignment ($OP) shorthand.","suppress":{"eslint":{"rules":["operator-assignment"]},"oxlint":{"rules":["operator-assignment"]},"biome":{"rules":["lint/style/useShorthandAssign"]}}}}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-prefer-numeric-literals","revision":3,"mode":"steer","description":"Port of ESLint's `prefer-numeric-literals` rule (https://eslint.org/docs/latest/rules/prefer-numeric-literals). Flags `parseInt(str, radix)` / `Number.parseInt(str, radix)` (global, resolved with `resolves`) with a string literal and a radix literal whose value is 2, 8 or 16, and fixes to the 0b/0o/0x literal when the string is a valid literal body.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"binary-fix","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"call_expression","all":[{"has":{"matches":"callee"}},{"has":{"kind":"arguments","all":[{"count":{"has":{"matches":"arg"},"min":2,"max":2}},{"has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"matches":"str-arg"}},{"has":{"matches":"radix","follows":{"regex":"^,$","stopBy":"end"}}}]}}]},{"all":[{"has":{"kind":"arguments","has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"has":{"kind":"string_fragment","regex":"^[01]+$","pattern":"$S"}}}},{"not":{"has":{"kind":"comment","stopBy":"end"}}},{"not":{"matches":"after-keyword"}},{"not":{"matches":"before-word-op"}}]}]},"utils":{"parse-int-inner":{"any":[{"kind":"identifier","resolves":{"global":["parseInt"],"directives":"eslint"}},{"kind":"member_expression","all":[{"has":{"kind":"property_identifier","regex":"^parseInt$"}},{"has":{"matches":"number-obj"}}]},{"kind":"subscript_expression","all":[{"has":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}}],"value":{"eq":"parseInt"}}},{"has":{"matches":"number-obj"}}]}]},"number-obj":{"any":[{"kind":"identifier","resolves":{"global":["Number"],"directives":"eslint"}},{"kind":"parenthesized_expression","has":{"matches":"number-obj"}}]},"callee":{"any":[{"all":[{"matches":"parse-int-inner"},{"pattern":"$FN"}]},{"kind":"parenthesized_expression","has":{"matches":"callee"}}]},"arg":{"not":{"any":[{"regex":"^[(),]$"},{"kind":"comment"}]}},"after-keyword":{"any":[{"follows":{"regex":"^(return|await|of|in|yield|typeof|void|delete|case|throw|new|else|do|instanceof)$"}},{"all":[{"not":{"follows":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"after-keyword"}}]}]},"before-word-op":{"any":[{"precedes":{"regex":"^(in|instanceof)$"}},{"all":[{"not":{"precedes":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"before-word-op"}}]}]},"str-arg":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}},{"kind":"parenthesized_expression","has":{"matches":"str-arg"}}]},"radix":{"any":[{"kind":"number","value":{"eq":2}},{"kind":"parenthesized_expression","has":{"matches":"radix"}}]}}}},"violation":{"anchor":"witness.span","code":"prefer-numeric-literals","message":"Use binary literals instead of $FN().","fix":"0b$S","suppress":{"eslint":{"rules":["prefer-numeric-literals"]},"oxlint":{"rules":["prefer-numeric-literals"]},"biome":{"rules":["lint/complexity/useNumericLiterals"]}}}},{"id":"binary","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"call_expression","all":[{"has":{"matches":"callee"}},{"has":{"kind":"arguments","all":[{"count":{"has":{"matches":"arg"},"min":2,"max":2}},{"has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"matches":"str-arg"}},{"has":{"matches":"radix","follows":{"regex":"^,$","stopBy":"end"}}}]}}]},{"not":{"all":[{"has":{"kind":"arguments","has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"has":{"kind":"string_fragment","regex":"^[01]+$","pattern":"$S"}}}},{"not":{"has":{"kind":"comment","stopBy":"end"}}},{"not":{"matches":"after-keyword"}},{"not":{"matches":"before-word-op"}}]}}]},"utils":{"parse-int-inner":{"any":[{"kind":"identifier","resolves":{"global":["parseInt"],"directives":"eslint"}},{"kind":"member_expression","all":[{"has":{"kind":"property_identifier","regex":"^parseInt$"}},{"has":{"matches":"number-obj"}}]},{"kind":"subscript_expression","all":[{"has":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}}],"value":{"eq":"parseInt"}}},{"has":{"matches":"number-obj"}}]}]},"number-obj":{"any":[{"kind":"identifier","resolves":{"global":["Number"],"directives":"eslint"}},{"kind":"parenthesized_expression","has":{"matches":"number-obj"}}]},"callee":{"any":[{"all":[{"matches":"parse-int-inner"},{"pattern":"$FN"}]},{"kind":"parenthesized_expression","has":{"matches":"callee"}}]},"arg":{"not":{"any":[{"regex":"^[(),]$"},{"kind":"comment"}]}},"after-keyword":{"any":[{"follows":{"regex":"^(return|await|of|in|yield|typeof|void|delete|case|throw|new|else|do|instanceof)$"}},{"all":[{"not":{"follows":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"after-keyword"}}]}]},"before-word-op":{"any":[{"precedes":{"regex":"^(in|instanceof)$"}},{"all":[{"not":{"precedes":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"before-word-op"}}]}]},"str-arg":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}},{"kind":"parenthesized_expression","has":{"matches":"str-arg"}}]},"radix":{"any":[{"kind":"number","value":{"eq":2}},{"kind":"parenthesized_expression","has":{"matches":"radix"}}]}}}},"violation":{"anchor":"witness.span","code":"prefer-numeric-literals","message":"Use binary literals instead of $FN().","suppress":{"eslint":{"rules":["prefer-numeric-literals"]},"oxlint":{"rules":["prefer-numeric-literals"]},"biome":{"rules":["lint/complexity/useNumericLiterals"]}}}},{"id":"octal-fix","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"call_expression","all":[{"has":{"matches":"callee"}},{"has":{"kind":"arguments","all":[{"count":{"has":{"matches":"arg"},"min":2,"max":2}},{"has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"matches":"str-arg"}},{"has":{"matches":"radix","follows":{"regex":"^,$","stopBy":"end"}}}]}}]},{"all":[{"has":{"kind":"arguments","has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"has":{"kind":"string_fragment","regex":"^[0-7]+$","pattern":"$S"}}}},{"not":{"has":{"kind":"comment","stopBy":"end"}}},{"not":{"matches":"after-keyword"}},{"not":{"matches":"before-word-op"}}]}]},"utils":{"parse-int-inner":{"any":[{"kind":"identifier","resolves":{"global":["parseInt"],"directives":"eslint"}},{"kind":"member_expression","all":[{"has":{"kind":"property_identifier","regex":"^parseInt$"}},{"has":{"matches":"number-obj"}}]},{"kind":"subscript_expression","all":[{"has":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}}],"value":{"eq":"parseInt"}}},{"has":{"matches":"number-obj"}}]}]},"number-obj":{"any":[{"kind":"identifier","resolves":{"global":["Number"],"directives":"eslint"}},{"kind":"parenthesized_expression","has":{"matches":"number-obj"}}]},"callee":{"any":[{"all":[{"matches":"parse-int-inner"},{"pattern":"$FN"}]},{"kind":"parenthesized_expression","has":{"matches":"callee"}}]},"arg":{"not":{"any":[{"regex":"^[(),]$"},{"kind":"comment"}]}},"after-keyword":{"any":[{"follows":{"regex":"^(return|await|of|in|yield|typeof|void|delete|case|throw|new|else|do|instanceof)$"}},{"all":[{"not":{"follows":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"after-keyword"}}]}]},"before-word-op":{"any":[{"precedes":{"regex":"^(in|instanceof)$"}},{"all":[{"not":{"precedes":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"before-word-op"}}]}]},"str-arg":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}},{"kind":"parenthesized_expression","has":{"matches":"str-arg"}}]},"radix":{"any":[{"kind":"number","value":{"eq":8}},{"kind":"parenthesized_expression","has":{"matches":"radix"}}]}}}},"violation":{"anchor":"witness.span","code":"prefer-numeric-literals","message":"Use octal literals instead of $FN().","fix":"0o$S","suppress":{"eslint":{"rules":["prefer-numeric-literals"]},"oxlint":{"rules":["prefer-numeric-literals"]},"biome":{"rules":["lint/complexity/useNumericLiterals"]}}}},{"id":"octal","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"call_expression","all":[{"has":{"matches":"callee"}},{"has":{"kind":"arguments","all":[{"count":{"has":{"matches":"arg"},"min":2,"max":2}},{"has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"matches":"str-arg"}},{"has":{"matches":"radix","follows":{"regex":"^,$","stopBy":"end"}}}]}}]},{"not":{"all":[{"has":{"kind":"arguments","has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"has":{"kind":"string_fragment","regex":"^[0-7]+$","pattern":"$S"}}}},{"not":{"has":{"kind":"comment","stopBy":"end"}}},{"not":{"matches":"after-keyword"}},{"not":{"matches":"before-word-op"}}]}}]},"utils":{"parse-int-inner":{"any":[{"kind":"identifier","resolves":{"global":["parseInt"],"directives":"eslint"}},{"kind":"member_expression","all":[{"has":{"kind":"property_identifier","regex":"^parseInt$"}},{"has":{"matches":"number-obj"}}]},{"kind":"subscript_expression","all":[{"has":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}}],"value":{"eq":"parseInt"}}},{"has":{"matches":"number-obj"}}]}]},"number-obj":{"any":[{"kind":"identifier","resolves":{"global":["Number"],"directives":"eslint"}},{"kind":"parenthesized_expression","has":{"matches":"number-obj"}}]},"callee":{"any":[{"all":[{"matches":"parse-int-inner"},{"pattern":"$FN"}]},{"kind":"parenthesized_expression","has":{"matches":"callee"}}]},"arg":{"not":{"any":[{"regex":"^[(),]$"},{"kind":"comment"}]}},"after-keyword":{"any":[{"follows":{"regex":"^(return|await|of|in|yield|typeof|void|delete|case|throw|new|else|do|instanceof)$"}},{"all":[{"not":{"follows":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"after-keyword"}}]}]},"before-word-op":{"any":[{"precedes":{"regex":"^(in|instanceof)$"}},{"all":[{"not":{"precedes":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"before-word-op"}}]}]},"str-arg":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}},{"kind":"parenthesized_expression","has":{"matches":"str-arg"}}]},"radix":{"any":[{"kind":"number","value":{"eq":8}},{"kind":"parenthesized_expression","has":{"matches":"radix"}}]}}}},"violation":{"anchor":"witness.span","code":"prefer-numeric-literals","message":"Use octal literals instead of $FN().","suppress":{"eslint":{"rules":["prefer-numeric-literals"]},"oxlint":{"rules":["prefer-numeric-literals"]},"biome":{"rules":["lint/complexity/useNumericLiterals"]}}}},{"id":"hexadecimal-fix","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"call_expression","all":[{"has":{"matches":"callee"}},{"has":{"kind":"arguments","all":[{"count":{"has":{"matches":"arg"},"min":2,"max":2}},{"has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"matches":"str-arg"}},{"has":{"matches":"radix","follows":{"regex":"^,$","stopBy":"end"}}}]}}]},{"all":[{"has":{"kind":"arguments","has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"has":{"kind":"string_fragment","regex":"^[0-9a-fA-F]+$","pattern":"$S"}}}},{"not":{"has":{"kind":"comment","stopBy":"end"}}},{"not":{"matches":"after-keyword"}},{"not":{"matches":"before-word-op"}}]}]},"utils":{"parse-int-inner":{"any":[{"kind":"identifier","resolves":{"global":["parseInt"],"directives":"eslint"}},{"kind":"member_expression","all":[{"has":{"kind":"property_identifier","regex":"^parseInt$"}},{"has":{"matches":"number-obj"}}]},{"kind":"subscript_expression","all":[{"has":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}}],"value":{"eq":"parseInt"}}},{"has":{"matches":"number-obj"}}]}]},"number-obj":{"any":[{"kind":"identifier","resolves":{"global":["Number"],"directives":"eslint"}},{"kind":"parenthesized_expression","has":{"matches":"number-obj"}}]},"callee":{"any":[{"all":[{"matches":"parse-int-inner"},{"pattern":"$FN"}]},{"kind":"parenthesized_expression","has":{"matches":"callee"}}]},"arg":{"not":{"any":[{"regex":"^[(),]$"},{"kind":"comment"}]}},"after-keyword":{"any":[{"follows":{"regex":"^(return|await|of|in|yield|typeof|void|delete|case|throw|new|else|do|instanceof)$"}},{"all":[{"not":{"follows":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"after-keyword"}}]}]},"before-word-op":{"any":[{"precedes":{"regex":"^(in|instanceof)$"}},{"all":[{"not":{"precedes":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"before-word-op"}}]}]},"str-arg":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}},{"kind":"parenthesized_expression","has":{"matches":"str-arg"}}]},"radix":{"any":[{"kind":"number","value":{"eq":16}},{"kind":"parenthesized_expression","has":{"matches":"radix"}}]}}}},"violation":{"anchor":"witness.span","code":"prefer-numeric-literals","message":"Use hexadecimal literals instead of $FN().","fix":"0x$S","suppress":{"eslint":{"rules":["prefer-numeric-literals"]},"oxlint":{"rules":["prefer-numeric-literals"]},"biome":{"rules":["lint/complexity/useNumericLiterals"]}}}},{"id":"hexadecimal","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"call_expression","all":[{"has":{"matches":"callee"}},{"has":{"kind":"arguments","all":[{"count":{"has":{"matches":"arg"},"min":2,"max":2}},{"has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"matches":"str-arg"}},{"has":{"matches":"radix","follows":{"regex":"^,$","stopBy":"end"}}}]}}]},{"not":{"all":[{"has":{"kind":"arguments","has":{"not":{"follows":{"regex":"^,$","stopBy":"end"}},"has":{"kind":"string_fragment","regex":"^[0-9a-fA-F]+$","pattern":"$S"}}}},{"not":{"has":{"kind":"comment","stopBy":"end"}}},{"not":{"matches":"after-keyword"}},{"not":{"matches":"before-word-op"}}]}}]},"utils":{"parse-int-inner":{"any":[{"kind":"identifier","resolves":{"global":["parseInt"],"directives":"eslint"}},{"kind":"member_expression","all":[{"has":{"kind":"property_identifier","regex":"^parseInt$"}},{"has":{"matches":"number-obj"}}]},{"kind":"subscript_expression","all":[{"has":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}}],"value":{"eq":"parseInt"}}},{"has":{"matches":"number-obj"}}]}]},"number-obj":{"any":[{"kind":"identifier","resolves":{"global":["Number"],"directives":"eslint"}},{"kind":"parenthesized_expression","has":{"matches":"number-obj"}}]},"callee":{"any":[{"all":[{"matches":"parse-int-inner"},{"pattern":"$FN"}]},{"kind":"parenthesized_expression","has":{"matches":"callee"}}]},"arg":{"not":{"any":[{"regex":"^[(),]$"},{"kind":"comment"}]}},"after-keyword":{"any":[{"follows":{"regex":"^(return|await|of|in|yield|typeof|void|delete|case|throw|new|else|do|instanceof)$"}},{"all":[{"not":{"follows":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"after-keyword"}}]}]},"before-word-op":{"any":[{"precedes":{"regex":"^(in|instanceof)$"}},{"all":[{"not":{"precedes":{"regex":"[\\s\\S]"}}},{"inside":{"matches":"before-word-op"}}]}]},"str-arg":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}},{"kind":"parenthesized_expression","has":{"matches":"str-arg"}}]},"radix":{"any":[{"kind":"number","value":{"eq":16}},{"kind":"parenthesized_expression","has":{"matches":"radix"}}]}}}},"violation":{"anchor":"witness.span","code":"prefer-numeric-literals","message":"Use hexadecimal literals instead of $FN().","suppress":{"eslint":{"rules":["prefer-numeric-literals"]},"oxlint":{"rules":["prefer-numeric-literals"]},"biome":{"rules":["lint/complexity/useNumericLiterals"]}}}}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-prefer-spread","revision":4,"mode":"steer","description":"Port of ESLint's `prefer-spread` rule (https://eslint.org/docs/latest/rules/prefer-spread). Flags `f.apply(thisArg, args)` (`apply` by static property name) with a non-literal argument list when thisArg is null/undefined for a plain function, or has the same tokens as the applied method's object (ESLint's equalTokens, `compare` text `tokens`).","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"prefer-spread","forbid":{"ast":{"language":"typescript","utils":{"unparen-exp":{"any":[{"not":{"kind":"parenthesized_expression"},"pattern":"$EXP"},{"kind":"parenthesized_expression","has":{"not":{"any":[{"regex":"^[()]$"},{"kind":"comment"}]},"matches":"unparen-exp"}}]},"member-like":{"any":[{"kind":"member_expression"},{"kind":"subscript_expression"}]},"apply-member":{"any":[{"kind":"member_expression","has":{"kind":"property_identifier","regex":"^apply$"}},{"kind":"subscript_expression","has":{"stopBy":"neighbor","follows":{"regex":"^\\[$","stopBy":{"not":{"kind":"comment"}}},"matches":"static-str","value":{"eq":"apply"}}}]},"unparen-apply":{"any":[{"matches":"apply-member"},{"kind":"parenthesized_expression","has":{"matches":"unparen-apply"}}]},"applied-object":{"any":[{"matches":"member-like","has":{"precedes":{"any":[{"regex":"^\\.$"},{"kind":"optional_chain"},{"regex":"^\\[$"}]},"matches":"unparen-exp"}},{"kind":"parenthesized_expression","has":{"matches":"applied-object"}}]},"applied-member":{"any":[{"matches":"apply-member","has":{"precedes":{"any":[{"regex":"^\\.$"},{"kind":"optional_chain"},{"regex":"^\\[$"}]},"matches":"applied-object"}},{"kind":"parenthesized_expression","has":{"matches":"applied-member"}}]},"unparen-member-like":{"any":[{"matches":"member-like"},{"kind":"parenthesized_expression","has":{"matches":"unparen-member-like"}}]},"applied-non-member":{"any":[{"matches":"apply-member","has":{"precedes":{"any":[{"regex":"^\\.$"},{"kind":"optional_chain"},{"regex":"^\\[$"}]},"not":{"matches":"unparen-member-like"}}},{"kind":"parenthesized_expression","has":{"matches":"applied-non-member"}}]},"null-or-undefined":{"any":[{"kind":"null"},{"kind":"undefined"},{"kind":"unary_expression","has":{"regex":"^void$"}},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","not":{"any":[{"regex":"^[()]$"},{"kind":"comment"}]},"matches":"null-or-undefined"}}]},"variadic-args":{"kind":"arguments","count":{"has":{"all":[{"not":{"kind":"comment"}},{"not":{"regex":"^[(),]$"}}]},"min":2,"max":2},"has":{"all":[{"all":[{"not":{"kind":"comment"}},{"not":{"regex":"^[(),]$"}}]},{"follows":{"regex":"^,$"}},{"not":{"kind":"array"}},{"not":{"kind":"spread_element"}}]}},"static-str":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution","stopBy":"neighbor"}}},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","not":{"kind":"comment"},"matches":"static-str"}}]},"unparen-arg":{"any":[{"not":{"kind":"parenthesized_expression"},"pattern":"$ARG"},{"kind":"parenthesized_expression","has":{"not":{"any":[{"regex":"^[()]$"},{"kind":"comment"}]},"matches":"unparen-arg"}}]}},"rule":{"kind":"call_expression","has":{"matches":"variadic-args"},"any":[{"all":[{"has":{"matches":"applied-member"}},{"has":{"kind":"arguments","has":{"not":{"kind":"comment"},"follows":{"regex":"^\\($","stopBy":{"not":{"kind":"comment"}}},"matches":"unparen-arg"}}},{"compare":{"left":"EXP","op":"eq","right":"ARG","text":"tokens"}}]},{"all":[{"has":{"matches":"applied-non-member"}},{"has":{"kind":"arguments","has":{"not":{"kind":"comment"},"follows":{"regex":"^\\($","stopBy":{"not":{"kind":"comment"}}},"matches":"null-or-undefined"}}}]}]}}},"violation":{"anchor":"witness.span","code":"prefer-spread","message":"Use the spread operator instead of '.apply()'.","suppress":{"eslint":{"rules":["prefer-spread"]},"oxlint":{"rules":["prefer-spread"]},"biome":{"rules":["lint/style/useSpreadOverApply"]}}}}]}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "rerail.policy/v1",
|
|
3
|
+
"id": "eslint-prefer-template",
|
|
4
|
+
"revision": 3,
|
|
5
|
+
"mode": "steer",
|
|
6
|
+
"description": "Port of ESLint's `prefer-template` rule (https://eslint.org/docs/latest/rules/prefer-template). Flags the outermost `+` concatenation chain that mixes a string literal with a non-string operand.",
|
|
7
|
+
"scope": {
|
|
8
|
+
"include": [
|
|
9
|
+
"**/*"
|
|
10
|
+
],
|
|
11
|
+
"exclude": []
|
|
12
|
+
},
|
|
13
|
+
"clauses": [
|
|
14
|
+
{
|
|
15
|
+
"id": "string-concatenation",
|
|
16
|
+
"forbid": {
|
|
17
|
+
"ast": {
|
|
18
|
+
"language": "typescript",
|
|
19
|
+
"rule": {
|
|
20
|
+
"kind": "binary_expression",
|
|
21
|
+
"all": [
|
|
22
|
+
{
|
|
23
|
+
"matches": "plus"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"not": {
|
|
27
|
+
"inside": {
|
|
28
|
+
"stopBy": {
|
|
29
|
+
"not": {
|
|
30
|
+
"kind": "parenthesized_expression"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"matches": "plus"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"matches": "chain-has-str"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"matches": "chain-has-nonstr"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"utils": {
|
|
46
|
+
"plus": {
|
|
47
|
+
"kind": "binary_expression",
|
|
48
|
+
"has": {
|
|
49
|
+
"stopBy": "neighbor",
|
|
50
|
+
"regex": "^\\+$"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"pplus": {
|
|
54
|
+
"any": [
|
|
55
|
+
{
|
|
56
|
+
"matches": "plus"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"kind": "parenthesized_expression",
|
|
60
|
+
"has": {
|
|
61
|
+
"stopBy": "neighbor",
|
|
62
|
+
"matches": "pplus"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"str": {
|
|
68
|
+
"any": [
|
|
69
|
+
{
|
|
70
|
+
"kind": "string"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"kind": "template_string"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"kind": "parenthesized_expression",
|
|
77
|
+
"has": {
|
|
78
|
+
"stopBy": "neighbor",
|
|
79
|
+
"matches": "str"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"chain-has-str": {
|
|
85
|
+
"any": [
|
|
86
|
+
{
|
|
87
|
+
"kind": "parenthesized_expression",
|
|
88
|
+
"has": {
|
|
89
|
+
"stopBy": "neighbor",
|
|
90
|
+
"matches": "chain-has-str"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"matches": "plus",
|
|
95
|
+
"has": {
|
|
96
|
+
"stopBy": "neighbor",
|
|
97
|
+
"any": [
|
|
98
|
+
{
|
|
99
|
+
"matches": "str"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"matches": "chain-has-str"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"chain-has-nonstr": {
|
|
110
|
+
"any": [
|
|
111
|
+
{
|
|
112
|
+
"kind": "parenthesized_expression",
|
|
113
|
+
"has": {
|
|
114
|
+
"stopBy": "neighbor",
|
|
115
|
+
"matches": "chain-has-nonstr"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"matches": "plus",
|
|
120
|
+
"has": {
|
|
121
|
+
"stopBy": "neighbor",
|
|
122
|
+
"any": [
|
|
123
|
+
{
|
|
124
|
+
"all": [
|
|
125
|
+
{
|
|
126
|
+
"not": {
|
|
127
|
+
"any": [
|
|
128
|
+
{
|
|
129
|
+
"kind": "comment"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"regex": "^\\+$"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"regex": "^[()]$"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"not": {
|
|
142
|
+
"matches": "str"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"not": {
|
|
147
|
+
"matches": "pplus"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"matches": "chain-has-nonstr"
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"violation": {
|
|
164
|
+
"anchor": "witness.span",
|
|
165
|
+
"code": "prefer-template",
|
|
166
|
+
"message": "Unexpected string concatenation.",
|
|
167
|
+
"suppress": {
|
|
168
|
+
"eslint": {
|
|
169
|
+
"rules": [
|
|
170
|
+
"prefer-template"
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
"oxlint": {
|
|
174
|
+
"rules": [
|
|
175
|
+
"prefer-template"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"biome": {
|
|
179
|
+
"rules": [
|
|
180
|
+
"lint/style/useTemplate"
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|