@neralabs/rerail-pack-javascript 0.1.3 → 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 +404 -0
- 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 -1
- 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 +2 -2
- 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 -1
- 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 -1
- 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 -1
- 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 -1
- package/rules/eslint-no-unused-private-class-members.json +1 -1
- 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 +2 -2
- 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-proto","revision":4,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-proto","revision":4,"mode":"steer","description":"Avoid the deprecated __proto__ property; use Object.getPrototypeOf() and Object.setPrototypeOf() instead.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"proto-member","forbid":{"ast":{"language":"typescript","utils":{"static-str":{"any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution","stopBy":"neighbor"}}},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"static-str"}}]}},"rule":{"any":[{"kind":"member_expression","has":{"kind":"property_identifier","stopBy":"neighbor","regex":"^(?:[_]|\\\\u005[fF]|\\\\u\\{0*5[fF]\\})(?:[_]|\\\\u005[fF]|\\\\u\\{0*5[fF]\\})(?:[p]|\\\\u0070|\\\\u\\{0*70\\})(?:[r]|\\\\u0072|\\\\u\\{0*72\\})(?:[o]|\\\\u006[fF]|\\\\u\\{0*6[fF]\\})(?:[t]|\\\\u0074|\\\\u\\{0*74\\})(?:[o]|\\\\u006[fF]|\\\\u\\{0*6[fF]\\})(?:[_]|\\\\u005[fF]|\\\\u\\{0*5[fF]\\})(?:[_]|\\\\u005[fF]|\\\\u\\{0*5[fF]\\})$"}},{"kind":"subscript_expression","has":{"stopBy":"neighbor","precedes":{"regex":"^\\]$","stopBy":"neighbor"},"matches":"static-str","value":{"eq":"__proto__"}}}]}}},"violation":{"anchor":"witness.span","code":"no-proto","message":"Replace __proto__ with Object.getPrototypeOf() or Object.setPrototypeOf().","suppress":{"eslint":{"rules":["no-proto"]},"oxlint":{"rules":["no-proto"]},"biome":{"rules":["lint/suspicious/noProto"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-no-prototype-builtins",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Call hasOwnProperty, isPrototypeOf and propertyIsEnumerable through Object.prototype, not on the object; it may shadow them or have no prototype.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"violation": {
|
|
48
48
|
"anchor": "capture.PROP",
|
|
49
49
|
"code": "no-prototype-builtins",
|
|
50
|
-
"message": "
|
|
50
|
+
"message": "Call Object.prototype.$PROP.call(obj, ...) instead; the object may override $PROP or have no prototype.",
|
|
51
51
|
"suppress": {
|
|
52
52
|
"eslint": {
|
|
53
53
|
"rules": [
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"violation": {
|
|
120
120
|
"anchor": "capture.PROP",
|
|
121
121
|
"code": "no-prototype-builtins",
|
|
122
|
-
"message": "
|
|
122
|
+
"message": "Call Object.prototype.$NAME.call(obj, ...) instead; the object may override $NAME or have no prototype.",
|
|
123
123
|
"suppress": {
|
|
124
124
|
"eslint": {
|
|
125
125
|
"rules": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-return-assign","revision":4,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-return-assign","revision":4,"mode":"steer","description":"Don't assign inside a return statement or an arrow function's expression body unless it is wrapped in parentheses; it reads like a mistyped comparison.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"option":{"type":"string","nullable":true,"default":null}}}},{"id":"shared","define":{"language":"typescript","utils":{"assign":{"any":[{"kind":"assignment_expression"},{"kind":"augmented_assignment_expression"}]},"parenthesised":{"all":[{"follows":{"regex":"^\\($","stopBy":"neighbor"}},{"precedes":{"regex":"^\\)$","stopBy":"neighbor"}}]},"sentinel":{"any":[{"kind":"expression_statement"},{"kind":"return_statement"},{"kind":"if_statement"},{"kind":"statement_block"},{"kind":"for_statement"},{"kind":"for_in_statement"},{"kind":"while_statement"},{"kind":"do_statement"},{"kind":"try_statement"},{"kind":"throw_statement"},{"kind":"switch_statement"},{"kind":"break_statement"},{"kind":"continue_statement"},{"kind":"labeled_statement"},{"kind":"empty_statement"},{"kind":"with_statement"},{"kind":"debugger_statement"},{"kind":"arrow_function"},{"kind":"function_expression"},{"kind":"generator_function"},{"kind":"class"}]}}}},{"id":"return-assignment","forbid":{"ast":{"language":"typescript","rule":{"all":[{"matches":"assign"},{"$option":"option","cases":{"always":[]},"default":[{"not":{"matches":"parenthesised"}}],"spread":true},{"inside":{"stopBy":{"matches":"sentinel"},"all":[{"kind":"return_statement"},{"pattern":"$SENT"}]}}]}}},"violation":{"anchor":"capture.SENT","code":"no-return-assign","message":"Return statement should not contain assignment.","suppress":{"eslint":{"rules":["no-return-assign"]},"oxlint":{"rules":["no-return-assign"]},"biome":{"rules":["lint/suspicious/noReturnAssign"]}}}},{"id":"arrow-assignment","forbid":{"ast":{"language":"typescript","rule":{"all":[{"matches":"assign"},{"$option":"option","cases":{"always":[]},"default":[{"not":{"matches":"parenthesised"}}],"spread":true},{"not":{"inside":{"kind":"formal_parameters","stopBy":{"matches":"sentinel"}}}},{"inside":{"stopBy":{"matches":"sentinel"},"all":[{"kind":"arrow_function"},{"pattern":"$SENT"}]}}]}}},"violation":{"anchor":"capture.SENT","code":"no-return-assign","message":"Arrow function should not return assignment.","suppress":{"eslint":{"rules":["no-return-assign"]},"oxlint":{"rules":["no-return-assign"]},"biome":{"rules":["lint/suspicious/noReturnAssign"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-no-script-url",
|
|
4
4
|
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Avoid javascript: URLs in strings and template literals; running code from a URL is a form of eval.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-no-self-compare",
|
|
4
4
|
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Don't compare a value to itself; the result is fixed, and to check for NaN use Number.isNaN() instead.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"violation": {
|
|
98
98
|
"anchor": "witness.span",
|
|
99
99
|
"code": "no-self-compare",
|
|
100
|
-
"message": "
|
|
100
|
+
"message": "Compare against the intended value instead of itself, or use Number.isNaN() to test for NaN.",
|
|
101
101
|
"suppress": {
|
|
102
102
|
"eslint": {
|
|
103
103
|
"rules": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-sequences","revision":2,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-sequences","revision":2,"mode":"steer","description":"Avoid the comma operator outside for-loop headers unless the sequence is wrapped in parentheses; it hides side effects and is easily mistaken for a separator.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"allowInParentheses":{"type":"boolean","nullable":true,"default":null}}}},{"id":"comma-operator","forbid":{"ast":{"language":"typescript","rule":{"regex":"^,$","not":{"follows":{"regex":"^,$","stopBy":"end"}},"inside":{"kind":"sequence_expression","stopBy":"neighbor","not":{"any":[{"matches":"for-init-or-update"},{"$option":"allowInParentheses","cases":{"false":[]},"default":[{"matches":"intent-parens"}],"spread":true}]}}},"utils":{"for-init-or-update":{"any":[{"inside":{"kind":"for_statement","stopBy":"neighbor"},"any":[{"follows":{"regex":"^\\($","stopBy":"neighbor"}},{"precedes":{"regex":"^\\)$","stopBy":"neighbor"}}]},{"inside":{"kind":"parenthesized_expression","stopBy":"neighbor","matches":"for-init-or-update"}}]},"intent-parens":{"inside":{"kind":"parenthesized_expression","stopBy":"neighbor","any":[{"not":{"inside":{"stopBy":"neighbor","any":[{"kind":"if_statement"},{"kind":"while_statement"},{"kind":"do_statement"},{"kind":"switch_statement"},{"kind":"with_statement"},{"kind":"arrow_function"}]}}},{"inside":{"kind":"parenthesized_expression","stopBy":"neighbor"}}]}}}}},"violation":{"anchor":"witness.span","code":"no-sequences","message":"Unexpected use of comma operator.","suppress":{"eslint":{"rules":["no-sequences"]},"oxlint":{"rules":["no-sequences"]},"biome":{"rules":["lint/complexity/noCommaOperator"]}}}}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-setter-return","revision":4,"mode":"steer","description":"Port of ESLint's `no-setter-return` rule (https://eslint.org/docs/latest/rules/no-setter-return). Flags `return <value>` in a setter (class or object `set` accessor, or the `set` function of a property descriptor passed to Object.defineProperty, Reflect.defineProperty, Object.defineProperties or Object.create), and an arrow descriptor setter's expression body. `Object` and `Reflect` must resolve to declared globals (`resolves` under `ast.languageOptions`).","scope":{"include":["**/*.js","**/*.jsx","**/*.mjs","**/*.cjs"],"exclude":[]},"clauses":[{"id":"return-value","forbid":{"ast":{"language":"typescript","languageOptions":{},"rule":{"kind":"return_statement","has":{"stopBy":"neighbor","not":{"regex":"^(return|;)$"}},"inside":{"stopBy":{"any":[{"kind":"function_declaration"},{"kind":"generator_function_declaration"},{"kind":"function_expression"},{"kind":"generator_function"},{"kind":"arrow_function"},{"kind":"method_definition"}]},"matches":"setter"}},"utils":{"callee-Object-defineProperty":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(defineProperty)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](defineProperty)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Object-defineProperty"}}]},"callee-Reflect-defineProperty":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Reflect"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(defineProperty)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Reflect"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](defineProperty)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Reflect-defineProperty"}}]},"callee-Object-create-defineProperties":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(create|defineProperties)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](create|defineProperties)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Object-create-defineProperties"}}]},"descriptor":{"kind":"object","any":[{"inside":{"kind":"arguments","stopBy":"neighbor","inside":{"kind":"call_expression","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"matches":"callee-Object-defineProperty"},{"matches":"callee-Reflect-defineProperty"}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}},"count":{"follows":{"regex":"^,$","stopBy":"end"},"min":2,"max":2}},{"inside":{"kind":"pair","stopBy":"neighbor","inside":{"kind":"object","stopBy":"neighbor","inside":{"kind":"arguments","stopBy":"neighbor","inside":{"kind":"call_expression","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"matches":"callee-Object-create-defineProperties"}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}},"count":{"follows":{"regex":"^,$","stopBy":"end"},"min":1,"max":1}}}}]},"setter":{"any":[{"kind":"method_definition","has":{"regex":"^set$","not":{"kind":"property_identifier"},"stopBy":"neighbor"}},{"kind":"method_definition","all":[{"not":{"has":{"regex":"^get$","not":{"kind":"property_identifier"},"stopBy":"neighbor"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"property_identifier","regex":"^set$"},{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"computed_property_name","has":{"stopBy":"neighbor","any":[{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"template_string","regex":"^`set`$"}]}}]}}],"inside":{"stopBy":"neighbor","matches":"descriptor"}},{"any":[{"kind":"function_expression"},{"kind":"generator_function"},{"kind":"arrow_function"}],"inside":{"kind":"pair","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"kind":"property_identifier","regex":"^set$"},{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"computed_property_name","has":{"stopBy":"neighbor","any":[{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"template_string","regex":"^`set`$"}]}}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}},"inside":{"stopBy":"neighbor","matches":"descriptor"}}}]}}}},"violation":{"anchor":"witness.span","code":"no-setter-return","message":"Setter cannot return a value.","suppress":{"eslint":{"rules":["no-setter-return"]},"oxlint":{"rules":["no-setter-return"]},"biome":{"rules":["lint/correctness/noSetterReturn"]}}}},{"id":"arrow-expression-body","forbid":{"ast":{"language":"typescript","languageOptions":{},"rule":{"not":{"any":[{"kind":"statement_block"},{"regex":"^=>$"}]},"follows":{"regex":"^=>$","stopBy":"neighbor"},"inside":{"stopBy":"neighbor","kind":"arrow_function","matches":"setter"}},"utils":{"callee-Object-defineProperty":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(defineProperty)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](defineProperty)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Object-defineProperty"}}]},"callee-Reflect-defineProperty":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Reflect"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(defineProperty)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Reflect"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](defineProperty)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Reflect-defineProperty"}}]},"callee-Object-create-defineProperties":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(create|defineProperties)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](create|defineProperties)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Object-create-defineProperties"}}]},"descriptor":{"kind":"object","any":[{"inside":{"kind":"arguments","stopBy":"neighbor","inside":{"kind":"call_expression","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"matches":"callee-Object-defineProperty"},{"matches":"callee-Reflect-defineProperty"}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}},"count":{"follows":{"regex":"^,$","stopBy":"end"},"min":2,"max":2}},{"inside":{"kind":"pair","stopBy":"neighbor","inside":{"kind":"object","stopBy":"neighbor","inside":{"kind":"arguments","stopBy":"neighbor","inside":{"kind":"call_expression","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"matches":"callee-Object-create-defineProperties"}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}},"count":{"follows":{"regex":"^,$","stopBy":"end"},"min":1,"max":1}}}}]},"setter":{"any":[{"kind":"method_definition","has":{"regex":"^set$","not":{"kind":"property_identifier"},"stopBy":"neighbor"}},{"kind":"method_definition","all":[{"not":{"has":{"regex":"^get$","not":{"kind":"property_identifier"},"stopBy":"neighbor"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"property_identifier","regex":"^set$"},{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"computed_property_name","has":{"stopBy":"neighbor","any":[{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"template_string","regex":"^`set`$"}]}}]}}],"inside":{"stopBy":"neighbor","matches":"descriptor"}},{"any":[{"kind":"function_expression"},{"kind":"generator_function"},{"kind":"arrow_function"}],"inside":{"kind":"pair","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"kind":"property_identifier","regex":"^set$"},{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"computed_property_name","has":{"stopBy":"neighbor","any":[{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"template_string","regex":"^`set`$"}]}}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}},"inside":{"stopBy":"neighbor","matches":"descriptor"}}}]}}}},"violation":{"anchor":"witness.span","code":"no-setter-return","message":"Setter cannot return a value.","suppress":{"eslint":{"rules":["no-setter-return"]},"oxlint":{"rules":["no-setter-return"]},"biome":{"rules":["lint/correctness/noSetterReturn"]}}}}]}
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-setter-return","revision":4,"mode":"steer","description":"Don't return a value from a JavaScript setter, including setters in property descriptors; the returned value is always ignored.","scope":{"include":["**/*.js","**/*.jsx","**/*.mjs","**/*.cjs"],"exclude":[]},"clauses":[{"id":"return-value","forbid":{"ast":{"language":"typescript","languageOptions":{},"rule":{"kind":"return_statement","has":{"stopBy":"neighbor","not":{"regex":"^(return|;)$"}},"inside":{"stopBy":{"any":[{"kind":"function_declaration"},{"kind":"generator_function_declaration"},{"kind":"function_expression"},{"kind":"generator_function"},{"kind":"arrow_function"},{"kind":"method_definition"}]},"matches":"setter"}},"utils":{"callee-Object-defineProperty":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(defineProperty)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](defineProperty)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Object-defineProperty"}}]},"callee-Reflect-defineProperty":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Reflect"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(defineProperty)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Reflect"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](defineProperty)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Reflect-defineProperty"}}]},"callee-Object-create-defineProperties":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(create|defineProperties)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](create|defineProperties)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Object-create-defineProperties"}}]},"descriptor":{"kind":"object","any":[{"inside":{"kind":"arguments","stopBy":"neighbor","inside":{"kind":"call_expression","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"matches":"callee-Object-defineProperty"},{"matches":"callee-Reflect-defineProperty"}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}},"count":{"follows":{"regex":"^,$","stopBy":"end"},"min":2,"max":2}},{"inside":{"kind":"pair","stopBy":"neighbor","inside":{"kind":"object","stopBy":"neighbor","inside":{"kind":"arguments","stopBy":"neighbor","inside":{"kind":"call_expression","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"matches":"callee-Object-create-defineProperties"}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}},"count":{"follows":{"regex":"^,$","stopBy":"end"},"min":1,"max":1}}}}]},"setter":{"any":[{"kind":"method_definition","has":{"regex":"^set$","not":{"kind":"property_identifier"},"stopBy":"neighbor"}},{"kind":"method_definition","all":[{"not":{"has":{"regex":"^get$","not":{"kind":"property_identifier"},"stopBy":"neighbor"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"property_identifier","regex":"^set$"},{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"computed_property_name","has":{"stopBy":"neighbor","any":[{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"template_string","regex":"^`set`$"}]}}]}}],"inside":{"stopBy":"neighbor","matches":"descriptor"}},{"any":[{"kind":"function_expression"},{"kind":"generator_function"},{"kind":"arrow_function"}],"inside":{"kind":"pair","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"kind":"property_identifier","regex":"^set$"},{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"computed_property_name","has":{"stopBy":"neighbor","any":[{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"template_string","regex":"^`set`$"}]}}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}},"inside":{"stopBy":"neighbor","matches":"descriptor"}}}]}}}},"violation":{"anchor":"witness.span","code":"no-setter-return","message":"Setter cannot return a value.","suppress":{"eslint":{"rules":["no-setter-return"]},"oxlint":{"rules":["no-setter-return"]},"biome":{"rules":["lint/correctness/noSetterReturn"]}}}},{"id":"arrow-expression-body","forbid":{"ast":{"language":"typescript","languageOptions":{},"rule":{"not":{"any":[{"kind":"statement_block"},{"regex":"^=>$"}]},"follows":{"regex":"^=>$","stopBy":"neighbor"},"inside":{"stopBy":"neighbor","kind":"arrow_function","matches":"setter"}},"utils":{"callee-Object-defineProperty":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(defineProperty)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](defineProperty)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Object-defineProperty"}}]},"callee-Reflect-defineProperty":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Reflect"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(defineProperty)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Reflect"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](defineProperty)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Reflect-defineProperty"}}]},"callee-Object-create-defineProperties":{"any":[{"kind":"member_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","kind":"property_identifier","regex":"^(create|defineProperties)$"}}]},{"kind":"subscript_expression","all":[{"has":{"stopBy":"neighbor","any":[{"kind":"identifier"},{"kind":"parenthesized_expression"}],"resolves":{"global":["Object"],"directives":"eslint"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string"}],"regex":"^['\"`](create|defineProperties)['\"`]$"}}]},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","matches":"callee-Object-create-defineProperties"}}]},"descriptor":{"kind":"object","any":[{"inside":{"kind":"arguments","stopBy":"neighbor","inside":{"kind":"call_expression","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"matches":"callee-Object-defineProperty"},{"matches":"callee-Reflect-defineProperty"}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}},"count":{"follows":{"regex":"^,$","stopBy":"end"},"min":2,"max":2}},{"inside":{"kind":"pair","stopBy":"neighbor","inside":{"kind":"object","stopBy":"neighbor","inside":{"kind":"arguments","stopBy":"neighbor","inside":{"kind":"call_expression","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"matches":"callee-Object-create-defineProperties"}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}},"count":{"follows":{"regex":"^,$","stopBy":"end"},"min":1,"max":1}}}}]},"setter":{"any":[{"kind":"method_definition","has":{"regex":"^set$","not":{"kind":"property_identifier"},"stopBy":"neighbor"}},{"kind":"method_definition","all":[{"not":{"has":{"regex":"^get$","not":{"kind":"property_identifier"},"stopBy":"neighbor"}}},{"has":{"stopBy":"neighbor","any":[{"kind":"property_identifier","regex":"^set$"},{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"computed_property_name","has":{"stopBy":"neighbor","any":[{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"template_string","regex":"^`set`$"}]}}]}}],"inside":{"stopBy":"neighbor","matches":"descriptor"}},{"any":[{"kind":"function_expression"},{"kind":"generator_function"},{"kind":"arrow_function"}],"inside":{"kind":"pair","stopBy":"neighbor","has":{"stopBy":"neighbor","any":[{"kind":"property_identifier","regex":"^set$"},{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"computed_property_name","has":{"stopBy":"neighbor","any":[{"kind":"string","regex":"^['\"]set['\"]$"},{"kind":"template_string","regex":"^`set`$"}]}}],"not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}},"inside":{"stopBy":"neighbor","matches":"descriptor"}}}]}}}},"violation":{"anchor":"witness.span","code":"no-setter-return","message":"Put this setter's arrow body in braces so it returns nothing; a setter's return value is ignored.","suppress":{"eslint":{"rules":["no-setter-return"]},"oxlint":{"rules":["no-setter-return"]},"biome":{"rules":["lint/correctness/noSetterReturn"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-no-sparse-arrays",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Avoid holes in array literals from consecutive commas; they create sparse arrays and usually come from a typo.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-no-template-curly-in-string",
|
|
4
4
|
"revision": 4,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Don't put template placeholders inside ordinary quoted strings; they are not interpolated, so use a template literal instead.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"violation": {
|
|
35
35
|
"anchor": "witness.span",
|
|
36
36
|
"code": "no-template-curly-in-string",
|
|
37
|
-
"message": "
|
|
37
|
+
"message": "Change these quotes to backticks so the ${...} is interpolated, or escape the $ if the text is meant literally.",
|
|
38
38
|
"suppress": {
|
|
39
39
|
"eslint": {
|
|
40
40
|
"rules": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-no-ternary",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Avoid the ternary conditional operator entirely; write an if statement instead.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-unneeded-ternary","revision":4,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-unneeded-ternary","revision":4,"mode":"steer","description":"Replace ternaries that choose between true and false, or that fall back from a value to itself, with the condition or a logical OR.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"defaultAssignment":{"type":"boolean","nullable":true,"default":null}}}},{"id":"shared","define":{"language":"typescript","utils":{"bool-lit":{"any":[{"kind":"true"},{"kind":"false"}]},"boolean-expression":{"any":[{"kind":"binary_expression","has":{"regex":"^(==|===|!=|!==|>|>=|<|<=|in|instanceof)$"}},{"kind":"unary_expression","has":{"regex":"^!$"}},{"kind":"parenthesized_expression","has":{"matches":"boolean-expression"}}]},"low-precedence":{"any":[{"kind":"sequence_expression"},{"kind":"assignment_expression"},{"kind":"augmented_assignment_expression"},{"kind":"arrow_function"},{"kind":"yield_expression"},{"kind":"ternary_expression"},{"kind":"binary_expression"}]},"or-operand-needs-parens":{"any":[{"kind":"sequence_expression"},{"kind":"assignment_expression"},{"kind":"augmented_assignment_expression"},{"kind":"arrow_function"},{"kind":"yield_expression"},{"kind":"ternary_expression"},{"kind":"binary_expression","has":{"regex":"^\\?\\?$"}}]},"same-identifier":{"any":[{"kind":"identifier","pattern":"$N"},{"kind":"parenthesized_expression","has":{"matches":"same-identifier"}}]},"r1":{"kind":"ternary_expression","pattern":"$T ? true : false"},"r2":{"kind":"ternary_expression","pattern":"$T ? false : true"},"r3":{"kind":"ternary_expression","pattern":"$T ? $B : $B"},"r4":{"kind":"ternary_expression","pattern":"$T ? $C : $A"}}}},{"id":"same-values-identifier-test","forbid":{"ast":{"language":"typescript","rule":{"matches":"r3"},"constraints":{"B":{"matches":"bool-lit"},"T":{"kind":"identifier"}}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with $B; both branches give the same value.","fix":"$B","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"same-values","forbid":{"ast":{"language":"typescript","rule":{"matches":"r3"},"constraints":{"B":{"matches":"bool-lit"},"T":{"not":{"kind":"identifier"}}}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with $B, since both branches match, keeping the condition as a statement only if it has side effects.","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"invert-strict-eq","forbid":{"ast":{"language":"typescript","rule":{"kind":"ternary_expression","pattern":"$L === $R ? false : true"}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with $L !== $R.","fix":"$L !== $R","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"invert-strict-ne","forbid":{"ast":{"language":"typescript","rule":{"kind":"ternary_expression","pattern":"$L !== $R ? false : true"}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with $L === $R.","fix":"$L === $R","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"invert-eq","forbid":{"ast":{"language":"typescript","rule":{"kind":"ternary_expression","pattern":"$L == $R ? false : true"}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with $L != $R.","fix":"$L != $R","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"invert-ne","forbid":{"ast":{"language":"typescript","rule":{"kind":"ternary_expression","pattern":"$L != $R ? false : true"}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with $L == $R.","fix":"$L == $R","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"invert-low-precedence","forbid":{"ast":{"language":"typescript","rule":{"matches":"r2"},"utils":{"inverse-op":{"kind":"binary_expression","has":{"regex":"^(==|===|!=|!==)$"}}},"constraints":{"T":{"all":[{"matches":"low-precedence"},{"not":{"matches":"inverse-op"}}]}}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with !($T).","fix":"!($T)","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"invert","forbid":{"ast":{"language":"typescript","rule":{"matches":"r2"},"constraints":{"T":{"not":{"matches":"low-precedence"}}}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with !$T.","fix":"!$T","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"boolean-test","forbid":{"ast":{"language":"typescript","rule":{"matches":"r1"},"constraints":{"T":{"matches":"boolean-expression"}}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with its condition $T.","fix":"$T","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"coerce-low-precedence","forbid":{"ast":{"language":"typescript","rule":{"matches":"r1"},"constraints":{"T":{"all":[{"matches":"low-precedence"},{"not":{"matches":"boolean-expression"}}]}}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with !!($T).","fix":"!!($T)","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"coerce","forbid":{"ast":{"language":"typescript","rule":{"matches":"r1"},"constraints":{"T":{"all":[{"not":{"matches":"low-precedence"}},{"not":{"matches":"boolean-expression"}}]}}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with !!$T.","fix":"!!$T","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"default-assignment-parenthesize","forbid":{"ast":{"language":"typescript","rule":{"matches":"r4"},"constraints":{"T":{"matches":"same-identifier"},"C":{"matches":"same-identifier"},"A":{"matches":"or-operand-needs-parens"}},"when":{"option":{"defaultAssignment":false}}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with $T || ($A).","fix":"$T || ($A)","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}},{"id":"default-assignment","forbid":{"ast":{"language":"typescript","rule":{"matches":"r4"},"constraints":{"T":{"matches":"same-identifier"},"C":{"matches":"same-identifier"},"A":{"not":{"matches":"or-operand-needs-parens"}}},"when":{"option":{"defaultAssignment":false}}}},"violation":{"anchor":"witness.span","code":"no-unneeded-ternary","message":"Replace this ternary with $T || $A.","fix":"$T || $A","suppress":{"eslint":{"rules":["no-unneeded-ternary"]},"oxlint":{"rules":["no-unneeded-ternary"]},"biome":{"rules":["lint/complexity/noUselessTernary"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-no-unsafe-finally",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Don't return, throw, break or continue out of a finally block; it silently overrides the result or exception of the try and catch blocks.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"violation": {
|
|
59
59
|
"anchor": "witness.span",
|
|
60
60
|
"code": "no-unsafe-finally",
|
|
61
|
-
"message": "
|
|
61
|
+
"message": "Move this return out of the finally block; it overrides the result or exception of the try and catch blocks.",
|
|
62
62
|
"suppress": {
|
|
63
63
|
"eslint": {
|
|
64
64
|
"rules": [
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"violation": {
|
|
126
126
|
"anchor": "witness.span",
|
|
127
127
|
"code": "no-unsafe-finally",
|
|
128
|
-
"message": "
|
|
128
|
+
"message": "Move this throw out of the finally block; it replaces the result or exception of the try and catch blocks.",
|
|
129
129
|
"suppress": {
|
|
130
130
|
"eslint": {
|
|
131
131
|
"rules": [
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
"violation": {
|
|
214
214
|
"anchor": "witness.span",
|
|
215
215
|
"code": "no-unsafe-finally",
|
|
216
|
-
"message": "
|
|
216
|
+
"message": "Move this break out of the finally block; it discards the result or exception of the try and catch blocks.",
|
|
217
217
|
"suppress": {
|
|
218
218
|
"eslint": {
|
|
219
219
|
"rules": [
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
"violation": {
|
|
299
299
|
"anchor": "witness.span",
|
|
300
300
|
"code": "no-unsafe-finally",
|
|
301
|
-
"message": "
|
|
301
|
+
"message": "Move this continue out of the finally block; it discards the result or exception of the try and catch blocks.",
|
|
302
302
|
"suppress": {
|
|
303
303
|
"eslint": {
|
|
304
304
|
"rules": [
|
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
"violation": {
|
|
423
423
|
"anchor": "witness.span",
|
|
424
424
|
"code": "no-unsafe-finally",
|
|
425
|
-
"message": "
|
|
425
|
+
"message": "Move this break out of the finally block; it discards the result or exception of the try and catch blocks.",
|
|
426
426
|
"suppress": {
|
|
427
427
|
"eslint": {
|
|
428
428
|
"rules": [
|
|
@@ -546,7 +546,7 @@
|
|
|
546
546
|
"violation": {
|
|
547
547
|
"anchor": "witness.span",
|
|
548
548
|
"code": "no-unsafe-finally",
|
|
549
|
-
"message": "
|
|
549
|
+
"message": "Move this continue out of the finally block; it discards the result or exception of the try and catch blocks.",
|
|
550
550
|
"suppress": {
|
|
551
551
|
"eslint": {
|
|
552
552
|
"rules": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-unsafe-negation","revision":5,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-unsafe-negation","revision":5,"mode":"steer","description":"Don't negate the left operand of in or instanceof in JavaScript; negate the whole parenthesized check, since the operator applies to the negated value.","scope":{"include":["**/*.js","**/*.jsx","**/*.mjs","**/*.cjs"],"exclude":[]},"clauses":[{"id":"options","define":{"options":{"enforceForOrderingRelations":{"type":"boolean","nullable":true,"default":null}}}},{"id":"negated-left-operand-of-in","forbid":{"ast":{"language":"typescript","rule":{"kind":"unary_expression","has":{"regex":"^!$","stopBy":"neighbor"},"precedes":{"regex":"^in$","stopBy":"neighbor"},"inside":{"kind":"binary_expression","stopBy":"neighbor"}}}},"violation":{"anchor":"witness.span","code":"no-unsafe-negation","message":"Unexpected negating the left operand of 'in' operator.","suppress":{"eslint":{"rules":["no-unsafe-negation"]},"oxlint":{"rules":["no-unsafe-negation"]},"biome":{"rules":["lint/suspicious/noUnsafeNegation"]}}}},{"id":"negated-left-operand-of-instanceof","forbid":{"ast":{"language":"typescript","rule":{"kind":"unary_expression","has":{"regex":"^!$","stopBy":"neighbor"},"precedes":{"regex":"^instanceof$","stopBy":"neighbor"},"inside":{"kind":"binary_expression","stopBy":"neighbor"}}}},"violation":{"anchor":"witness.span","code":"no-unsafe-negation","message":"Unexpected negating the left operand of 'instanceof' operator.","suppress":{"eslint":{"rules":["no-unsafe-negation"]},"oxlint":{"rules":["no-unsafe-negation"]},"biome":{"rules":["lint/suspicious/noUnsafeNegation"]}}}},{"id":"negated-left-operand-of-lt","forbid":{"ast":{"language":"typescript","rule":{"kind":"unary_expression","has":{"regex":"^!$","stopBy":"neighbor"},"precedes":{"regex":"^<$","stopBy":"neighbor"},"inside":{"kind":"binary_expression","stopBy":"neighbor"}},"when":{"option":{"enforceForOrderingRelations":true}}}},"violation":{"anchor":"witness.span","code":"no-unsafe-negation","message":"Negate the whole comparison, as in !(a < b), or write (!a) < b if negating the operand is intended.","suppress":{"eslint":{"rules":["no-unsafe-negation"]},"oxlint":{"rules":["no-unsafe-negation"]},"biome":{"rules":["lint/suspicious/noUnsafeNegation"]}}}},{"id":"negated-left-operand-of-gt","forbid":{"ast":{"language":"typescript","rule":{"kind":"unary_expression","has":{"regex":"^!$","stopBy":"neighbor"},"precedes":{"regex":"^>$","stopBy":"neighbor"},"inside":{"kind":"binary_expression","stopBy":"neighbor"}},"when":{"option":{"enforceForOrderingRelations":true}}}},"violation":{"anchor":"witness.span","code":"no-unsafe-negation","message":"Negate the whole comparison, as in !(a > b), or write (!a) > b if negating the operand is intended.","suppress":{"eslint":{"rules":["no-unsafe-negation"]},"oxlint":{"rules":["no-unsafe-negation"]},"biome":{"rules":["lint/suspicious/noUnsafeNegation"]}}}},{"id":"negated-left-operand-of-le","forbid":{"ast":{"language":"typescript","rule":{"kind":"unary_expression","has":{"regex":"^!$","stopBy":"neighbor"},"precedes":{"regex":"^<=$","stopBy":"neighbor"},"inside":{"kind":"binary_expression","stopBy":"neighbor"}},"when":{"option":{"enforceForOrderingRelations":true}}}},"violation":{"anchor":"witness.span","code":"no-unsafe-negation","message":"Negate the whole comparison, as in !(a <= b), or write (!a) <= b if negating the operand is intended.","suppress":{"eslint":{"rules":["no-unsafe-negation"]},"oxlint":{"rules":["no-unsafe-negation"]},"biome":{"rules":["lint/suspicious/noUnsafeNegation"]}}}},{"id":"negated-left-operand-of-ge","forbid":{"ast":{"language":"typescript","rule":{"kind":"unary_expression","has":{"regex":"^!$","stopBy":"neighbor"},"precedes":{"regex":"^>=$","stopBy":"neighbor"},"inside":{"kind":"binary_expression","stopBy":"neighbor"}},"when":{"option":{"enforceForOrderingRelations":true}}}},"violation":{"anchor":"witness.span","code":"no-unsafe-negation","message":"Negate the whole comparison, as in !(a >= b), or write (!a) >= b if negating the operand is intended.","suppress":{"eslint":{"rules":["no-unsafe-negation"]},"oxlint":{"rules":["no-unsafe-negation"]},"biome":{"rules":["lint/suspicious/noUnsafeNegation"]}}}}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-unused-labels","revision":2,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-unused-labels","revision":2,"mode":"steer","description":"Remove labels that no break or continue statement uses; they are dead code that confuses readers.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"unused-label-fixable","forbid":{"ast":{"language":"typescript","rule":{"all":[{"matches":"unused"},{"matches":"body"},{"not":{"matches":"unfixable"}}]},"utils":{"unused":{"all":[{"kind":"labeled_statement"},{"has":{"kind":"statement_identifier","pattern":"$L","stopBy":"neighbor"}},{"not":{"has":{"stopBy":{"any":[{"kind":"function_declaration"},{"kind":"function_expression"},{"kind":"arrow_function"},{"kind":"generator_function_declaration"},{"kind":"generator_function"},{"kind":"method_definition"},{"kind":"class_static_block"}]},"any":[{"kind":"break_statement"},{"kind":"continue_statement"}],"has":{"kind":"statement_identifier","pattern":"$L","stopBy":"neighbor"}}}}]},"body":{"has":{"stopBy":"neighbor","pattern":"$BODY","not":{"any":[{"kind":"statement_identifier"},{"kind":"comment"}]}}},"directive-body":{"all":[{"kind":"expression_statement"},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution","stopBy":"neighbor"}}},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution","stopBy":"neighbor"}}}]}}]}}]},"unfixable":{"any":[{"has":{"kind":"comment","stopBy":"neighbor"}},{"all":[{"has":{"stopBy":"neighbor","matches":"directive-body"}},{"inside":{"stopBy":{"not":{"kind":"labeled_statement"}},"any":[{"kind":"program"},{"kind":"statement_block","inside":{"stopBy":"neighbor","any":[{"kind":"function_declaration"},{"kind":"function_expression"},{"kind":"arrow_function"},{"kind":"generator_function_declaration"},{"kind":"generator_function"},{"kind":"method_definition"}]}}]}}]},{"all":[{"has":{"stopBy":"neighbor","not":{"any":[{"kind":"statement_identifier"},{"kind":"comment"}]},"regex":"^[(\\[\\-+/`]"}},{"follows":{"stopBy":{"not":{"kind":"comment"}},"not":{"kind":"comment"},"regex":"[^;{:]$"}}]}]}}}},"violation":{"anchor":"capture.L","code":"no-unused-labels","message":"'$L:' is defined but never used.","fix":"$BODY","suppress":{"eslint":{"rules":["no-unused-labels"]},"oxlint":{"rules":["no-unused-labels"]},"biome":{"rules":["lint/correctness/noUnusedLabels"]}}}},{"id":"unused-label","forbid":{"ast":{"language":"typescript","rule":{"all":[{"matches":"unused"},{"matches":"unfixable"}]},"utils":{"unused":{"all":[{"kind":"labeled_statement"},{"has":{"kind":"statement_identifier","pattern":"$L","stopBy":"neighbor"}},{"not":{"has":{"stopBy":{"any":[{"kind":"function_declaration"},{"kind":"function_expression"},{"kind":"arrow_function"},{"kind":"generator_function_declaration"},{"kind":"generator_function"},{"kind":"method_definition"},{"kind":"class_static_block"}]},"any":[{"kind":"break_statement"},{"kind":"continue_statement"}],"has":{"kind":"statement_identifier","pattern":"$L","stopBy":"neighbor"}}}}]},"directive-body":{"all":[{"kind":"expression_statement"},{"has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution","stopBy":"neighbor"}}},{"kind":"parenthesized_expression","has":{"stopBy":"neighbor","any":[{"kind":"string"},{"kind":"template_string","not":{"has":{"kind":"template_substitution","stopBy":"neighbor"}}}]}}]}}]},"unfixable":{"any":[{"has":{"kind":"comment","stopBy":"neighbor"}},{"all":[{"has":{"stopBy":"neighbor","matches":"directive-body"}},{"inside":{"stopBy":{"not":{"kind":"labeled_statement"}},"any":[{"kind":"program"},{"kind":"statement_block","inside":{"stopBy":"neighbor","any":[{"kind":"function_declaration"},{"kind":"function_expression"},{"kind":"arrow_function"},{"kind":"generator_function_declaration"},{"kind":"generator_function"},{"kind":"method_definition"}]}}]}}]},{"all":[{"has":{"stopBy":"neighbor","not":{"any":[{"kind":"statement_identifier"},{"kind":"comment"}]},"regex":"^[(\\[\\-+/`]"}},{"follows":{"stopBy":{"not":{"kind":"comment"}},"not":{"kind":"comment"},"regex":"[^;{:]$"}}]}]}}}},"violation":{"anchor":"capture.L","code":"no-unused-labels","message":"'$L:' is defined but never used.","suppress":{"eslint":{"rules":["no-unused-labels"]},"oxlint":{"rules":["no-unused-labels"]},"biome":{"rules":["lint/correctness/noUnusedLabels"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-no-unused-private-class-members",
|
|
4
4
|
"revision": 2,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove private class fields, methods and accessors that are never used inside the class; assignments alone don't count as use.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-useless-call","revision":3,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-useless-call","revision":3,"mode":"steer","description":"Call functions directly instead of through call() or apply() with the same this value they would get anyway.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"useless-call","forbid":{"ast":{"language":"typescript","utils":{"applied":{"any":[{"kind":"parenthesized_expression","has":{"matches":"applied","stopBy":"neighbor"}},{"not":{"any":[{"kind":"parenthesized_expression"},{"kind":"comment"}]},"pattern":"$A"}]},"expected-this":{"any":[{"kind":"parenthesized_expression","has":{"matches":"expected-this","stopBy":"neighbor"}},{"not":{"any":[{"kind":"parenthesized_expression"},{"kind":"comment"}]},"pattern":"$T"}]},"callee":{"any":[{"kind":"parenthesized_expression","has":{"matches":"callee","stopBy":"neighbor"}},{"kind":"member_expression","all":[{"has":{"kind":"property_identifier","regex":"^(call|apply)$","pattern":"$NAME","stopBy":"neighbor"}},{"has":{"not":{"any":[{"kind":"property_identifier"},{"kind":"optional_chain"},{"kind":"comment"}]},"matches":"applied","stopBy":"neighbor"}}]}]},"first-argument":{"all":[{"not":{"any":[{"kind":"comment"},{"regex":"^[(),]$"}]}},{"not":{"follows":{"stopBy":"end","all":[{"not":{"any":[{"kind":"comment"},{"regex":"^[(),]$"}]}}]}}}]},"null-or-undefined":{"any":[{"kind":"parenthesized_expression","has":{"matches":"null-or-undefined","stopBy":"neighbor"}},{"kind":"null"},{"kind":"undefined"},{"kind":"unary_expression","has":{"regex":"^void$","stopBy":"neighbor"}}]},"call-arguments":{"kind":"arguments","any":[{"all":[{"matches":"call-name"},{"has":{"not":{"any":[{"kind":"comment"},{"regex":"^[(),]$"}]},"stopBy":"neighbor"}}]},{"all":[{"matches":"apply-name"},{"count":{"has":{"not":{"any":[{"kind":"comment"},{"regex":"^[(),]$"}]},"stopBy":"neighbor"},"min":2,"max":2}},{"has":{"kind":"array","not":{"precedes":{"stopBy":"end","all":[{"not":{"any":[{"kind":"comment"},{"regex":"^[(),]$"}]}}]}},"stopBy":"neighbor"}}]}]},"call-name":{"follows":{"stopBy":"end","matches":"callee-call"}},"apply-name":{"follows":{"stopBy":"end","matches":"callee-apply"}},"callee-call":{"any":[{"kind":"parenthesized_expression","has":{"matches":"callee-call","stopBy":"neighbor"}},{"kind":"member_expression","has":{"kind":"property_identifier","regex":"^call$","stopBy":"neighbor"}}]},"callee-apply":{"any":[{"kind":"parenthesized_expression","has":{"matches":"callee-apply","stopBy":"neighbor"}},{"kind":"member_expression","has":{"kind":"property_identifier","regex":"^apply$","stopBy":"neighbor"}}]},"callee-object-member":{"any":[{"kind":"parenthesized_expression","has":{"matches":"callee-object-member","stopBy":"neighbor"}},{"kind":"member_expression","has":{"not":{"any":[{"kind":"property_identifier"},{"kind":"optional_chain"},{"kind":"comment"}]},"matches":"member-object","stopBy":"neighbor"}}]},"member-object":{"any":[{"kind":"parenthesized_expression","has":{"matches":"member-object","stopBy":"neighbor"}},{"any":[{"kind":"member_expression"},{"kind":"subscript_expression"}],"has":{"not":{"any":[{"kind":"property_identifier"},{"kind":"private_property_identifier"},{"kind":"optional_chain"},{"kind":"comment"}]},"matches":"expected-this","stopBy":"neighbor"}}]},"this-arg":{"any":[{"kind":"parenthesized_expression","has":{"matches":"this-arg","stopBy":"neighbor"}},{"not":{"any":[{"kind":"parenthesized_expression"},{"kind":"comment"}]},"pattern":"$ARG"}]}},"rule":{"kind":"call_expression","all":[{"has":{"matches":"callee","stopBy":"neighbor"}},{"has":{"matches":"call-arguments","stopBy":"neighbor"}},{"any":[{"all":[{"has":{"matches":"callee-object-member","stopBy":"neighbor"}},{"has":{"kind":"arguments","has":{"matches":"first-argument","all":[{"matches":"this-arg"}],"stopBy":"neighbor"},"stopBy":"neighbor"}}],"compare":{"left":"ARG","op":"eq","right":"T","text":"tokens"}},{"all":[{"not":{"has":{"matches":"callee-object-member","stopBy":"neighbor"}}},{"has":{"kind":"arguments","has":{"matches":"first-argument","all":[{"matches":"null-or-undefined"}],"stopBy":"neighbor"},"stopBy":"neighbor"}}]}]}]}}},"violation":{"anchor":"witness.span","code":"no-useless-call","message":"Unnecessary '.$NAME()'.","suppress":{"eslint":{"rules":["no-useless-call"]},"oxlint":{"rules":["no-useless-call"]}}}}]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "eslint-no-useless-catch",
|
|
4
4
|
"revision": 3,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove catch clauses that only rethrow the caught error; they add nothing but nesting.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":"rerail.policy/v1","id":"eslint-no-useless-concat","revision":4,"mode":"steer","description":"
|
|
1
|
+
{"format":"rerail.policy/v1","id":"eslint-no-useless-concat","revision":4,"mode":"steer","description":"Avoid concatenating two string literals on the same line in JavaScript; write them as a single string.","scope":{"include":["**/*"],"exclude":[]},"clauses":[{"id":"literal-concat","forbid":{"ast":{"language":"typescript","rule":{"regex":"^\\+$","inside":{"kind":"binary_expression","stopBy":"neighbor"},"follows":{"matches":"right-most-literal","stopBy":{"not":{"kind":"comment"}}},"precedes":{"matches":"left-most-literal","stopBy":{"not":{"kind":"comment"}}}},"utils":{"right-most-literal":{"any":[{"any":[{"kind":"string"},{"kind":"template_string"}],"pattern":"$L"},{"kind":"parenthesized_expression","has":{"matches":"right-most-literal","stopBy":"neighbor"}},{"kind":"binary_expression","all":[{"has":{"regex":"^\\+$","stopBy":"neighbor"}},{"has":{"matches":"right-most-literal","stopBy":"neighbor","not":{"precedes":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}]}]},"left-most-literal":{"any":[{"any":[{"kind":"string"},{"kind":"template_string"}],"layout":{"before":{"to":"capture.L","breaks":{"eq":0}}}},{"kind":"parenthesized_expression","has":{"matches":"left-most-literal","stopBy":"neighbor"}},{"kind":"binary_expression","all":[{"has":{"regex":"^\\+$","stopBy":"neighbor"}},{"has":{"matches":"left-most-literal","stopBy":"neighbor","not":{"follows":{"regex":"[\\s\\S]","stopBy":"neighbor"}}}}]}]}}}},"violation":{"anchor":"witness.span","code":"no-useless-concat","message":"Unexpected string concatenation of literals.","suppress":{"eslint":{"rules":["no-useless-concat"]},"oxlint":{"rules":["no-useless-concat"]},"biome":{"rules":["lint/complexity/noUselessStringConcat"]}}}}]}
|
|
@@ -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"]}}}}]}
|