@neralabs/rerail-pack-javascript 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +416 -3
- package/licenses/eslint/UPSTREAM.md +28 -3
- package/licenses/eslint-plugin-unicorn/UPSTREAM.md +39 -2
- package/pack.json +43 -3
- package/package.json +1 -1
- package/rules/eslint-arrow-body-style.json +1 -1
- package/rules/eslint-capitalized-comments.json +1 -1
- package/rules/eslint-curly.json +1 -0
- package/rules/eslint-default-case-last.json +1 -1
- package/rules/eslint-default-case.json +1 -1
- package/rules/eslint-eqeqeq.json +1 -1
- package/rules/eslint-func-style.json +1 -1
- package/rules/eslint-guard-for-in.json +1 -1
- package/rules/eslint-no-bitwise.json +1 -1
- package/rules/eslint-no-caller.json +2 -2
- package/rules/eslint-no-case-declarations.json +2 -2
- package/rules/eslint-no-compare-neg-zero.json +2 -2
- package/rules/eslint-no-cond-assign.json +1 -1
- package/rules/eslint-no-console.json +1 -1
- package/rules/eslint-no-continue.json +2 -2
- package/rules/eslint-no-debugger.json +1 -1
- package/rules/eslint-no-delete-var.json +2 -2
- package/rules/eslint-no-div-regex.json +1 -1
- package/rules/eslint-no-dupe-keys.json +3 -7
- package/rules/eslint-no-duplicate-case.json +2 -2
- package/rules/eslint-no-empty-pattern.json +1 -1
- package/rules/eslint-no-empty-static-block.json +2 -2
- package/rules/eslint-no-empty.json +2 -2
- package/rules/eslint-no-eq-null.json +1 -1
- package/rules/eslint-no-extend-native.json +1 -1
- package/rules/eslint-no-inline-comments.json +1 -1
- package/rules/eslint-no-iterator.json +1 -1
- package/rules/eslint-no-labels.json +1 -0
- package/rules/eslint-no-loss-of-precision.json +1 -1
- package/rules/eslint-no-multi-str.json +2 -2
- package/rules/eslint-no-negated-condition.json +2 -2
- package/rules/eslint-no-nested-ternary.json +1 -1
- package/rules/eslint-no-new-wrappers.json +1 -1
- package/rules/eslint-no-new.json +2 -2
- package/rules/eslint-no-nonoctal-decimal-escape.json +2 -2
- package/rules/eslint-no-object-constructor.json +1 -0
- package/rules/eslint-no-octal-escape.json +1 -1
- package/rules/eslint-no-octal.json +2 -2
- package/rules/eslint-no-plusplus.json +1 -1
- package/rules/eslint-no-proto.json +1 -1
- package/rules/eslint-no-prototype-builtins.json +3 -3
- package/rules/eslint-no-return-assign.json +1 -1
- package/rules/eslint-no-script-url.json +1 -1
- package/rules/eslint-no-self-compare.json +2 -2
- package/rules/eslint-no-sequences.json +1 -0
- package/rules/eslint-no-setter-return.json +1 -1
- package/rules/eslint-no-sparse-arrays.json +1 -1
- package/rules/eslint-no-template-curly-in-string.json +2 -2
- package/rules/eslint-no-ternary.json +1 -1
- package/rules/eslint-no-unneeded-ternary.json +1 -1
- package/rules/eslint-no-unsafe-finally.json +7 -7
- package/rules/eslint-no-unsafe-negation.json +1 -1
- package/rules/eslint-no-unused-labels.json +1 -0
- package/rules/eslint-no-unused-private-class-members.json +83 -0
- package/rules/eslint-no-useless-call.json +1 -1
- package/rules/eslint-no-useless-catch.json +1 -1
- package/rules/eslint-no-useless-concat.json +1 -1
- package/rules/eslint-no-void.json +1 -1
- package/rules/eslint-no-warning-comments.json +1 -1
- package/rules/eslint-no-with.json +7 -4
- package/rules/eslint-operator-assignment.json +1 -1
- package/rules/eslint-prefer-numeric-literals.json +1 -1
- package/rules/eslint-prefer-spread.json +1 -1
- package/rules/eslint-prefer-template.json +2 -2
- package/rules/eslint-radix.json +2 -2
- package/rules/eslint-sort-imports.json +1 -1
- package/rules/eslint-sort-keys.json +1 -1
- package/rules/eslint-sort-vars.json +1 -1
- package/rules/eslint-use-isnan.json +3 -3
- package/rules/eslint-valid-typeof.json +1 -1
- package/rules/eslint-yoda.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-void","revision":4,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-void","revision":4,"mode":"steer","description":"Avoid the void operator; write undefined directly when you mean it.","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"]}}}}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-warning-comments","revision":4,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-warning-comments","revision":4,"mode":"steer","description":"Remove comments that start with TODO, FIXME or XXX; track unfinished work in an issue instead.","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"]}}}}]}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "rerail.policy/v1",
|
|
3
3
|
"id": "eslint-no-with",
|
|
4
|
-
"revision":
|
|
4
|
+
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Don't use with statements in JavaScript; they make variable lookup ambiguous and are forbidden in strict mode.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
|
-
"
|
|
9
|
+
"**/*.js",
|
|
10
|
+
"**/*.jsx",
|
|
11
|
+
"**/*.mjs",
|
|
12
|
+
"**/*.cjs"
|
|
10
13
|
],
|
|
11
14
|
"exclude": []
|
|
12
15
|
},
|
|
@@ -27,7 +30,7 @@
|
|
|
27
30
|
"violation": {
|
|
28
31
|
"anchor": "witness.span",
|
|
29
32
|
"code": "no-with",
|
|
30
|
-
"message": "
|
|
33
|
+
"message": "Remove this with statement and reference the object's properties explicitly through a variable.",
|
|
31
34
|
"suppress": {
|
|
32
35
|
"eslint": {
|
|
33
36
|
"rules": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-operator-assignment","revision":6,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-operator-assignment","revision":6,"mode":"steer","description":"Use compound assignment operators like += when a variable is assigned the result of an operation on itself.","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":"Expand this $OP into a plain assignment that repeats the variable, like x = x + 1.","suppress":{"eslint":{"rules":["operator-assignment"]},"oxlint":{"rules":["operator-assignment"]},"biome":{"rules":["lint/style/useShorthandAssign"]}}}}]}
|
|
@@ -1 +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"]}}}}]}
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-prefer-numeric-literals","revision":3,"mode":"steer","description":"Use binary, octal or hexadecimal number literals instead of parseInt() on a constant string with radix 2, 8 or 16.","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":"Replace this $FN() call with the binary literal 0b$S.","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":"Replace this $FN() call with the octal literal 0o$S.","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":"Replace this $FN() call with the hexadecimal literal 0x$S.","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"]}}}}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-prefer-spread","revision":4,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-prefer-spread","revision":4,"mode":"steer","description":"Use spread syntax instead of .apply() to call a function with an array of arguments.","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"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-prefer-template",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use template literals instead of building strings by joining string literals and other values with +.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"violation": {
|
|
164
164
|
"anchor": "witness.span",
|
|
165
165
|
"code": "prefer-template",
|
|
166
|
-
"message": "
|
|
166
|
+
"message": "Rewrite this + string concatenation as a single template literal.",
|
|
167
167
|
"suppress": {
|
|
168
168
|
"eslint": {
|
|
169
169
|
"rules": [
|
package/rules/eslint-radix.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-radix",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Pass a radix between 2 and 36 to every parseInt() call; without one, some inputs are parsed in an unexpected base.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"violation": {
|
|
135
135
|
"anchor": "witness.span",
|
|
136
136
|
"code": "radix",
|
|
137
|
-
"message": "
|
|
137
|
+
"message": "Pass the string to parse and a radix to this call, like parseInt(value, 10).",
|
|
138
138
|
"suppress": {
|
|
139
139
|
"eslint": {
|
|
140
140
|
"rules": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-sort-imports","revision":3,"mode":"steer","description":"Port of ESLint's `sort-imports` rule (https://eslint.org/docs/latest/rules/sort-imports). Each import is compared with the previous import declaration: member-syntax group order (none, all, multiple, single), then the first local name within a group; import specifiers must be sorted by local name (first unsorted one reported). No fix (the fix sorts a list). 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":{"ignoreCase":{"type":"boolean","nullable":true,"default":null},"ignoreDeclarationSort":{"type":"boolean","nullable":true,"default":null},"ignoreMemberSort":{"type":"boolean","nullable":true,"default":null},"memberSyntaxSortOrder":{"type":"array","items":"string","nullable":true,"default":null},"allowSeparatedGroups":{"type":"boolean","nullable":true,"default":null}}}},{"id":"shared","define":{"language":"typescript","utils":{"default-id":{"kind":"identifier","inside":{"kind":"import_clause"}},"spec":{"any":[{"kind":"import_specifier"},{"kind":"namespace_import"},{"matches":"default-id"}]},"syntax-all":{"all":[{"matches":"r11"},{"not":{"has":{"matches":"default-id","stopBy":"end"}}}]},"syntax-multiple":{"count":{"has":{"matches":"spec","stopBy":"end"},"min":2}},"syntax-none":{"not":{"has":{"matches":"spec","stopBy":"end"}}},"syntax-single":{"all":[{"count":{"has":{"matches":"spec","stopBy":"end"},"min":1,"max":1}},{"not":{"matches":"r11"}}]},"r1":{"has":{"has":{"any":[{"kind":"identifier","pattern":"$PREV"},{"has":{"kind":"identifier","pattern":"$PREV"},"kind":"namespace_import"},{"has":{"all":[{"kind":"import_specifier"},{"matches":"r10"},{"has":{"kind":"identifier","not":{"precedes":{"regex":"^as$"}},"pattern":"$PREV"}}]},"kind":"named_imports"}]},"kind":"import_clause"}},"r2":{"has":{"has":{"any":[{"kind":"identifier","pattern":"$CUR"},{"has":{"kind":"identifier","pattern":"$CUR"},"kind":"namespace_import"},{"has":{"all":[{"kind":"import_specifier"},{"matches":"r10"},{"has":{"kind":"identifier","not":{"precedes":{"regex":"^as$"}},"pattern":"$CUR"}}]},"kind":"named_imports"}]},"kind":"import_clause"}},"r3":{"not":{"layout":{"before":{"breaks":{"min":2},"to":"capture.PD"}}}},"r4":{"follows":{"kind":"import_statement","matches":"syntax-single","pattern":"$PD","stopBy":{"kind":"import_statement"}}},"r5":{"follows":{"kind":"import_statement","matches":"syntax-multiple","stopBy":{"kind":"import_statement"}}},"r6":{"follows":{"kind":"import_statement","matches":"syntax-single","stopBy":{"kind":"import_statement"}}},"r7":{"follows":{"kind":"import_statement","matches":"syntax-none","stopBy":{"kind":"import_statement"}}},"r8":{"follows":{"kind":"import_statement","matches":"syntax-all","stopBy":{"kind":"import_statement"}}},"r9":{"follows":{"kind":"import_statement","matches":"syntax-multiple","pattern":"$PD","stopBy":{"kind":"import_statement"}}},"r10":{"not":{"follows":{"kind":"import_specifier","stopBy":"end"}}},"r11":{"has":{"kind":"namespace_import","stopBy":"end"}}}}},{"id":"syntax-all-before-single","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-all"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r6"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r4"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null,"memberSyntaxSortOrder":{"in":[null,["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'all' syntax before 'single' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-all-before-multiple","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-all"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r5"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r9"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null,"memberSyntaxSortOrder":{"in":[null,["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'all' syntax before 'multiple' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-all-before-none","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-all"},{"matches":"r7"}]},"when":{"option":{"memberSyntaxSortOrder":["all","single","multiple","none"]}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'all' syntax before 'none' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-single-before-multiple","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-single"},{"matches":"r5"}]},"when":{"option":{"memberSyntaxSortOrder":{"in":[["single","multiple","none","all"],["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'single' syntax before 'multiple' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-single-before-none","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-single"},{"matches":"r7"}]},"when":{"option":{"memberSyntaxSortOrder":{"in":[["single","multiple","none","all"],["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'single' syntax before 'none' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-single-before-all","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-single"},{"matches":"r8"}]},"when":{"option":{"memberSyntaxSortOrder":["single","multiple","none","all"]}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'single' syntax before 'all' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-multiple-before-none","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-multiple"},{"matches":"r7"}]},"when":{"option":{"memberSyntaxSortOrder":{"in":[["single","multiple","none","all"],["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'multiple' syntax before 'none' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-multiple-before-all","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-multiple"},{"matches":"r8"}]},"when":{"option":{"memberSyntaxSortOrder":["single","multiple","none","all"]}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'multiple' syntax before 'all' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-none-before-all","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-none"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r8"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"follows":{"matches":"syntax-all","kind":"import_statement","stopBy":{"kind":"import_statement"},"pattern":"$PD"}}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null,"memberSyntaxSortOrder":{"in":[null,["single","multiple","none","all"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'none' syntax before 'all' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-none-before-multiple","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-none"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r5"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r9"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"memberSyntaxSortOrder":null,"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'none' syntax before 'multiple' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-none-before-single","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-none"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r6"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r4"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"memberSyntaxSortOrder":null,"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'none' syntax before 'single' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-multiple-before-single","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-multiple"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r6"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r4"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"memberSyntaxSortOrder":null,"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Expected 'multiple' syntax before 'single' syntax.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"alphabetical-all","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-all"},{"matches":"r2"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"follows":{"all":[{"matches":"syntax-all"},{"matches":"r1"}],"compare":{"$option":"ignoreCase","cases":{"true":{"left":"CUR","op":"lt","right":"PREV","collation":"fold-lower"}},"default":{"left":"CUR","op":"lt","right":"PREV"}},"kind":"import_statement","stopBy":{"kind":"import_statement"}}}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"follows":{"all":[{"matches":"syntax-all"},{"matches":"r1"}],"compare":{"left":"CUR","op":"lt","right":"PREV"},"kind":"import_statement","stopBy":{"kind":"import_statement"},"pattern":"$PD"}}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Imports should be sorted alphabetically.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"alphabetical-single","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-single"},{"matches":"r2"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"follows":{"all":[{"matches":"syntax-single"},{"matches":"r1"}],"compare":{"$option":"ignoreCase","cases":{"true":{"left":"CUR","op":"lt","right":"PREV","collation":"fold-lower"}},"default":{"left":"CUR","op":"lt","right":"PREV"}},"kind":"import_statement","stopBy":{"kind":"import_statement"}}}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"follows":{"all":[{"matches":"syntax-single"},{"matches":"r1"}],"compare":{"left":"CUR","op":"lt","right":"PREV"},"kind":"import_statement","stopBy":{"kind":"import_statement"},"pattern":"$PD"}}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Imports should be sorted alphabetically.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"alphabetical-multiple","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-multiple"},{"matches":"r2"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"follows":{"all":[{"matches":"syntax-multiple"},{"matches":"r1"}],"compare":{"$option":"ignoreCase","cases":{"true":{"left":"CUR","op":"lt","right":"PREV","collation":"fold-lower"}},"default":{"left":"CUR","op":"lt","right":"PREV"}},"kind":"import_statement","stopBy":{"kind":"import_statement"}}}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"follows":{"all":[{"matches":"syntax-multiple"},{"matches":"r1"}],"compare":{"left":"CUR","op":"lt","right":"PREV"},"kind":"import_statement","stopBy":{"kind":"import_statement"},"pattern":"$PD"}}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Imports should be sorted alphabetically.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"member-order","forbid":{"ast":{"language":"typescript","rule":{"all":[{"all":[{"kind":"import_specifier"},{"has":{"kind":"identifier","pattern":"$M","not":{"precedes":{"regex":"^as$"}}}},{"follows":{"all":[{"kind":"import_specifier"},{"has":{"kind":"identifier","pattern":"$PM","not":{"precedes":{"regex":"^as$"}}}}],"stopBy":{"kind":"import_specifier"},"compare":{"$option":"ignoreCase","cases":{"true":{"left":"M","op":"lt","right":"PM","collation":"fold-lower"}},"default":{"left":"M","op":"lt","right":"PM"}}}}]},{"not":{"matches":"earlier-unsorted"}}]},"utils":{"earlier-unsorted":{"follows":{"all":[{"kind":"import_specifier"},{"has":{"kind":"identifier","pattern":"$M2","not":{"precedes":{"regex":"^as$"}}}},{"follows":{"all":[{"kind":"import_specifier"},{"has":{"kind":"identifier","pattern":"$PM2","not":{"precedes":{"regex":"^as$"}}}}],"stopBy":{"kind":"import_specifier"},"compare":{"$option":"ignoreCase","cases":{"true":{"left":"M2","op":"lt","right":"PM2","collation":"fold-lower"}},"default":{"left":"M2","op":"lt","right":"PM2"}}}}],"stopBy":"end"}}},"when":{"option":{"ignoreMemberSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Member '$M' of the import declaration should be sorted alphabetically.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}}]}
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-sort-imports","revision":3,"mode":"steer","description":"Sort import declarations by import style and then alphabetically, and list the names inside each import alphabetically.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"ignoreCase":{"type":"boolean","nullable":true,"default":null},"ignoreDeclarationSort":{"type":"boolean","nullable":true,"default":null},"ignoreMemberSort":{"type":"boolean","nullable":true,"default":null},"memberSyntaxSortOrder":{"type":"array","items":"string","nullable":true,"default":null},"allowSeparatedGroups":{"type":"boolean","nullable":true,"default":null}}}},{"id":"shared","define":{"language":"typescript","utils":{"default-id":{"kind":"identifier","inside":{"kind":"import_clause"}},"spec":{"any":[{"kind":"import_specifier"},{"kind":"namespace_import"},{"matches":"default-id"}]},"syntax-all":{"all":[{"matches":"r11"},{"not":{"has":{"matches":"default-id","stopBy":"end"}}}]},"syntax-multiple":{"count":{"has":{"matches":"spec","stopBy":"end"},"min":2}},"syntax-none":{"not":{"has":{"matches":"spec","stopBy":"end"}}},"syntax-single":{"all":[{"count":{"has":{"matches":"spec","stopBy":"end"},"min":1,"max":1}},{"not":{"matches":"r11"}}]},"r1":{"has":{"has":{"any":[{"kind":"identifier","pattern":"$PREV"},{"has":{"kind":"identifier","pattern":"$PREV"},"kind":"namespace_import"},{"has":{"all":[{"kind":"import_specifier"},{"matches":"r10"},{"has":{"kind":"identifier","not":{"precedes":{"regex":"^as$"}},"pattern":"$PREV"}}]},"kind":"named_imports"}]},"kind":"import_clause"}},"r2":{"has":{"has":{"any":[{"kind":"identifier","pattern":"$CUR"},{"has":{"kind":"identifier","pattern":"$CUR"},"kind":"namespace_import"},{"has":{"all":[{"kind":"import_specifier"},{"matches":"r10"},{"has":{"kind":"identifier","not":{"precedes":{"regex":"^as$"}},"pattern":"$CUR"}}]},"kind":"named_imports"}]},"kind":"import_clause"}},"r3":{"not":{"layout":{"before":{"breaks":{"min":2},"to":"capture.PD"}}}},"r4":{"follows":{"kind":"import_statement","matches":"syntax-single","pattern":"$PD","stopBy":{"kind":"import_statement"}}},"r5":{"follows":{"kind":"import_statement","matches":"syntax-multiple","stopBy":{"kind":"import_statement"}}},"r6":{"follows":{"kind":"import_statement","matches":"syntax-single","stopBy":{"kind":"import_statement"}}},"r7":{"follows":{"kind":"import_statement","matches":"syntax-none","stopBy":{"kind":"import_statement"}}},"r8":{"follows":{"kind":"import_statement","matches":"syntax-all","stopBy":{"kind":"import_statement"}}},"r9":{"follows":{"kind":"import_statement","matches":"syntax-multiple","pattern":"$PD","stopBy":{"kind":"import_statement"}}},"r10":{"not":{"follows":{"kind":"import_specifier","stopBy":"end"}}},"r11":{"has":{"kind":"namespace_import","stopBy":"end"}}}}},{"id":"syntax-all-before-single","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-all"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r6"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r4"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null,"memberSyntaxSortOrder":{"in":[null,["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this namespace import (import * as x) above the single-name imports.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-all-before-multiple","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-all"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r5"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r9"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null,"memberSyntaxSortOrder":{"in":[null,["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this namespace import (import * as x) above the multi-name imports.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-all-before-none","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-all"},{"matches":"r7"}]},"when":{"option":{"memberSyntaxSortOrder":["all","single","multiple","none"]}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this namespace import (import * as x) above the side-effect import (import 'x')s.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-single-before-multiple","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-single"},{"matches":"r5"}]},"when":{"option":{"memberSyntaxSortOrder":{"in":[["single","multiple","none","all"],["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this single-name import above the multi-name imports.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-single-before-none","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-single"},{"matches":"r7"}]},"when":{"option":{"memberSyntaxSortOrder":{"in":[["single","multiple","none","all"],["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this single-name import above the side-effect import (import 'x')s.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-single-before-all","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-single"},{"matches":"r8"}]},"when":{"option":{"memberSyntaxSortOrder":["single","multiple","none","all"]}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this single-name import above the namespace import (import * as x)s.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-multiple-before-none","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-multiple"},{"matches":"r7"}]},"when":{"option":{"memberSyntaxSortOrder":{"in":[["single","multiple","none","all"],["all","single","multiple","none"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this multi-name import above the side-effect import (import 'x')s.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-multiple-before-all","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-multiple"},{"matches":"r8"}]},"when":{"option":{"memberSyntaxSortOrder":["single","multiple","none","all"]}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this multi-name import above the namespace import (import * as x)s.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-none-before-all","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-none"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r8"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"follows":{"matches":"syntax-all","kind":"import_statement","stopBy":{"kind":"import_statement"},"pattern":"$PD"}}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null,"memberSyntaxSortOrder":{"in":[null,["single","multiple","none","all"]]}}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this side-effect import (import 'x') above the namespace import (import * as x)s.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-none-before-multiple","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-none"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r5"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r9"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"memberSyntaxSortOrder":null,"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this side-effect import (import 'x') above the multi-name imports.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-none-before-single","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-none"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r6"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r4"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"memberSyntaxSortOrder":null,"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this side-effect import (import 'x') above the single-name imports.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"syntax-multiple-before-single","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-multiple"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"matches":"r6"}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r4"}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"memberSyntaxSortOrder":null,"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this multi-name import above the single-name imports.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"alphabetical-all","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-all"},{"matches":"r2"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"follows":{"all":[{"matches":"syntax-all"},{"matches":"r1"}],"compare":{"$option":"ignoreCase","cases":{"true":{"left":"CUR","op":"lt","right":"PREV","collation":"fold-lower"}},"default":{"left":"CUR","op":"lt","right":"PREV"}},"kind":"import_statement","stopBy":{"kind":"import_statement"}}}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"follows":{"all":[{"matches":"syntax-all"},{"matches":"r1"}],"compare":{"left":"CUR","op":"lt","right":"PREV"},"kind":"import_statement","stopBy":{"kind":"import_statement"},"pattern":"$PD"}}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this import so the imports are in alphabetical order by their first imported name.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"alphabetical-single","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-single"},{"matches":"r2"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"follows":{"all":[{"matches":"syntax-single"},{"matches":"r1"}],"compare":{"$option":"ignoreCase","cases":{"true":{"left":"CUR","op":"lt","right":"PREV","collation":"fold-lower"}},"default":{"left":"CUR","op":"lt","right":"PREV"}},"kind":"import_statement","stopBy":{"kind":"import_statement"}}}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"follows":{"all":[{"matches":"syntax-single"},{"matches":"r1"}],"compare":{"left":"CUR","op":"lt","right":"PREV"},"kind":"import_statement","stopBy":{"kind":"import_statement"},"pattern":"$PD"}}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this import so the imports are in alphabetical order by their first imported name.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"alphabetical-multiple","forbid":{"ast":{"language":"typescript","rule":{"all":[{"kind":"import_statement"},{"matches":"syntax-multiple"},{"matches":"r2"},{"$option":"allowSeparatedGroups","cases":{"true":[]},"default":[{"follows":{"all":[{"matches":"syntax-multiple"},{"matches":"r1"}],"compare":{"$option":"ignoreCase","cases":{"true":{"left":"CUR","op":"lt","right":"PREV","collation":"fold-lower"}},"default":{"left":"CUR","op":"lt","right":"PREV"}},"kind":"import_statement","stopBy":{"kind":"import_statement"}}}],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"follows":{"all":[{"matches":"syntax-multiple"},{"matches":"r1"}],"compare":{"left":"CUR","op":"lt","right":"PREV"},"kind":"import_statement","stopBy":{"kind":"import_statement"},"pattern":"$PD"}}]},"default":[],"spread":true},{"$option":"allowSeparatedGroups","cases":{"true":[{"matches":"r3"}]},"default":[],"spread":true}]},"when":{"option":{"ignoreDeclarationSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Move this import so the imports are in alphabetical order by their first imported name.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}},{"id":"member-order","forbid":{"ast":{"language":"typescript","rule":{"all":[{"all":[{"kind":"import_specifier"},{"has":{"kind":"identifier","pattern":"$M","not":{"precedes":{"regex":"^as$"}}}},{"follows":{"all":[{"kind":"import_specifier"},{"has":{"kind":"identifier","pattern":"$PM","not":{"precedes":{"regex":"^as$"}}}}],"stopBy":{"kind":"import_specifier"},"compare":{"$option":"ignoreCase","cases":{"true":{"left":"M","op":"lt","right":"PM","collation":"fold-lower"}},"default":{"left":"M","op":"lt","right":"PM"}}}}]},{"not":{"matches":"earlier-unsorted"}}]},"utils":{"earlier-unsorted":{"follows":{"all":[{"kind":"import_specifier"},{"has":{"kind":"identifier","pattern":"$M2","not":{"precedes":{"regex":"^as$"}}}},{"follows":{"all":[{"kind":"import_specifier"},{"has":{"kind":"identifier","pattern":"$PM2","not":{"precedes":{"regex":"^as$"}}}}],"stopBy":{"kind":"import_specifier"},"compare":{"$option":"ignoreCase","cases":{"true":{"left":"M2","op":"lt","right":"PM2","collation":"fold-lower"}},"default":{"left":"M2","op":"lt","right":"PM2"}}}}],"stopBy":"end"}}},"when":{"option":{"ignoreMemberSort":null}}}},"violation":{"anchor":"witness.span","code":"sort-imports","message":"Member '$M' of the import declaration should be sorted alphabetically.","suppress":{"eslint":{"rules":["sort-imports"]},"oxlint":{"rules":["sort-imports"]}}}}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-sort-keys","revision":3,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-sort-keys","revision":3,"mode":"steer","description":"Sort object literal keys in ascending, case-sensitive alphabetical order, starting a new run after each spread.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"option":{"type":"string","nullable":true,"default":null},"allowLineSeparatedGroups":{"type":"boolean","nullable":true,"default":null},"caseSensitive":{"type":"boolean","nullable":true,"default":null},"natural":{"type":"boolean","nullable":true,"default":null},"ignoreComputedKeys":{"type":"boolean","nullable":true,"default":null},"minKeys":{"type":"integer","nullable":true,"default":null}}}},{"id":"shared","define":{"language":"typescript","utils":{"r1":{"any":[{"kind":"property_identifier"},{"kind":"string"},{"kind":"number"}]},"r2":{"has":{"kind":"computed_property_name","stopBy":"neighbor"}},"r3":{"any":[{"kind":"formal_parameters"},{"kind":"type_parameters"}]},"r4":{"layout":{"before":{"blank":{"min":1},"to":"sibling"}}}}}},{"id":"sort-keys","forbid":{"ast":{"language":"typescript","utils":{"this-key":{"any":[{"kind":"pair","has":{"stopBy":"neighbor","precedes":{"regex":"^:$"},"any":[{"all":[{"matches":"r1"},{"pattern":"$THIS"}]},{"$option":"ignoreComputedKeys","cases":{"true":[]},"default":[{"kind":"computed_property_name","has":{"stopBy":"neighbor","all":[{"matches":"static-computed-key"},{"pattern":"$THIS"}]}}],"spread":true}]}},{"kind":"method_definition","has":{"stopBy":"neighbor","precedes":{"matches":"r3"},"any":[{"all":[{"matches":"r1"},{"pattern":"$THIS"}]},{"$option":"ignoreComputedKeys","cases":{"true":[]},"default":[{"kind":"computed_property_name","has":{"stopBy":"neighbor","all":[{"matches":"static-computed-key"},{"pattern":"$THIS"}]}}],"spread":true}]}},{"kind":"shorthand_property_identifier","pattern":"$THIS"}]},"prev-key":{"any":[{"kind":"pair","has":{"stopBy":"neighbor","precedes":{"regex":"^:$"},"any":[{"all":[{"matches":"r1"},{"pattern":"$PREV"}]},{"$option":"ignoreComputedKeys","cases":{"true":[]},"default":[{"kind":"computed_property_name","has":{"stopBy":"neighbor","all":[{"matches":"static-computed-key"},{"pattern":"$PREV"}]}}],"spread":true}]}},{"kind":"method_definition","has":{"stopBy":"neighbor","precedes":{"matches":"r3"},"any":[{"all":[{"matches":"r1"},{"pattern":"$PREV"}]},{"$option":"ignoreComputedKeys","cases":{"true":[]},"default":[{"kind":"computed_property_name","has":{"stopBy":"neighbor","all":[{"matches":"static-computed-key"},{"pattern":"$PREV"}]}}],"spread":true}]}},{"kind":"shorthand_property_identifier","pattern":"$PREV"}]},"property":{"any":[{"kind":"pair"},{"kind":"method_definition"},{"kind":"shorthand_property_identifier"}]},"named":{"all":[{"matches":"property"},{"$option":"ignoreComputedKeys","cases":{"true":{"not":{"matches":"r2"}}},"default":{"any":[{"not":{"matches":"r2"}},{"has":{"stopBy":"neighbor","kind":"computed_property_name","has":{"stopBy":"neighbor","matches":"static-computed-key"}}}]}}]},"static-computed-key":{"any":[{"kind":"string"},{"kind":"number"},{"kind":"regex"},{"kind":"identifier"},{"kind":"undefined"},{"kind":"false"},{"kind":"true"},{"kind":"null"},{"kind":"template_string","not":{"has":{"kind":"template_substitution"}}}]},"reset":{"any":[{"kind":"spread_element"},{"$option":"ignoreComputedKeys","cases":{"true":[{"all":[{"matches":"property"},{"matches":"r2"}]}]},"default":[],"spread":true}]},"ident-key":{"has":{"stopBy":"neighbor","kind":"computed_property_name","has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"undefined"}]}}}},"rule":{"all":[{"$option":"minKeys","cases":{"4":[{"inside":{"kind":"object","stopBy":"neighbor","count":{"has":{"stopBy":"neighbor","any":[{"matches":"property"},{"kind":"spread_element"}]},"min":{"$option":"minKeys","cases":{"null":4},"default":{"$option":"minKeys"}}}}}],"5":[{"inside":{"kind":"object","stopBy":"neighbor","count":{"has":{"stopBy":"neighbor","any":[{"matches":"property"},{"kind":"spread_element"}]},"min":{"$option":"minKeys","cases":{"null":4},"default":{"$option":"minKeys"}}}}}],"3":[{"inside":{"kind":"object","stopBy":"neighbor","count":{"has":{"stopBy":"neighbor","any":[{"matches":"property"},{"kind":"spread_element"}]},"min":{"$option":"minKeys","cases":{"null":4},"default":{"$option":"minKeys"}}}}}]},"default":[],"spread":true},{"matches":"named"},{"$option":"allowLineSeparatedGroups","cases":{"true":[{"not":{"matches":"r4"}}]},"default":[],"spread":true},{"$option":"allowLineSeparatedGroups","cases":{"true":[{"not":{"follows":{"stopBy":{"any":[{"matches":"named"},{"matches":"reset"}]},"all":[{"matches":"property"},{"not":{"matches":"named"}},{"matches":"r4"}]}}}]},"default":[],"spread":true},{"inside":{"kind":"object","stopBy":"neighbor"},"matches":"this-key","follows":{"stopBy":{"any":[{"matches":"named"},{"matches":"reset"}]},"all":[{"matches":"named"},{"matches":"prev-key"},{"pattern":"$PP"}]},"pattern":"$TP"},{"any":[{"not":{"matches":"ident-key"},"follows":{"stopBy":{"any":[{"matches":"named"},{"matches":"reset"}]},"all":[{"matches":"named"},{"not":{"matches":"ident-key"}}]},"compare":{"left":"PP","op":{"$option":"option","cases":{"desc":"lt"},"default":"gt"},"right":"TP","collation":{"$option":"caseSensitive","cases":{"false":{"$option":"natural","cases":{"true":"natural-fold-lower"},"default":"fold-lower"}},"default":{"$option":"natural","cases":{"true":"natural"},"default":"ordinal"}},"text":"key"}},{"any":[{"matches":"ident-key"},{"follows":{"stopBy":{"any":[{"matches":"named"},{"matches":"reset"}]},"all":[{"matches":"named"},{"matches":"ident-key"}]}}],"compare":{"left":"PREV","op":{"$option":"option","cases":{"desc":"lt"},"default":"gt"},"right":"THIS","collation":{"$option":"caseSensitive","cases":{"false":{"$option":"natural","cases":{"true":"natural-fold-lower"},"default":"fold-lower"}},"default":{"$option":"natural","cases":{"true":"natural"},"default":"ordinal"}},"text":"unquoted"}}]}]},"transform":{"TN":{"substring":{"source":"$THIS","value":true}},"PN":{"substring":{"source":"$PREV","value":true}}}}},"violation":{"anchor":"capture.THIS","code":"sort-keys","message":{"$option":"caseSensitive","cases":{"false":{"$option":"option","cases":{"asc":{"$option":"natural","cases":{"true":"Expected object keys to be in natural insensitive ascending order. '$TN' should be before '$PN'."},"default":"Expected object keys to be in insensitive ascending order. '$TN' should be before '$PN'."}},"default":{"$option":"natural","cases":{"true":"Expected object keys to be in natural insensitive descending order. '$TN' should be before '$PN'."},"default":"Expected object keys to be in insensitive descending order. '$TN' should be before '$PN'."}}},"default":{"$option":"option","cases":{"desc":{"$option":"natural","cases":{"true":"Expected object keys to be in natural descending order. '$TN' should be before '$PN'."},"default":"Expected object keys to be in descending order. '$TN' should be before '$PN'."}},"default":{"$option":"natural","cases":{"true":"Expected object keys to be in natural ascending order. '$TN' should be before '$PN'."},"default":"Expected object keys to be in ascending order. '$TN' should be before '$PN'."}}},"suppress":{"eslint":{"rules":["sort-keys"]},"oxlint":{"rules":["sort-keys"]}}}}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-sort-vars","revision":3,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-sort-vars","revision":3,"mode":"steer","description":"Sort variables declared in the same declaration statement alphabetically, case-sensitive.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"ignoreCase":{"type":"boolean","nullable":true,"default":null}}}},{"id":"sort-vars","forbid":{"ast":{"language":"typescript","rule":{"kind":"variable_declarator","all":[{"has":{"stopBy":"neighbor","kind":"identifier","pattern":"$NAME","not":{"follows":{"stopBy":"neighbor","regex":"^=$"}}}},{"follows":{"stopBy":"end","kind":"variable_declarator","has":{"stopBy":"neighbor","kind":"identifier","pattern":"$PREV","not":{"follows":{"stopBy":"neighbor","regex":"^=$"}},"compare":{"left":"PREV","op":"gt","right":"NAME","collation":{"$option":"ignoreCase","cases":{"true":"fold-lower"},"default":"ordinal"}}}}}]}}},"violation":{"anchor":"witness.span","code":"sort-vars","message":"Variables within the same declaration block should be sorted alphabetically.","suppress":{"eslint":{"rules":["sort-vars"]},"oxlint":{"rules":["sort-vars"]}}}}]}
|