-
-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(linter): can't disable no-nested-ternary
rule anymore
#8600
base: main
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
CodSpeed Performance ReportMerging #8600 will not alter performanceComparing Summary
|
@@ -465,9 +469,8 @@ mod test { | |||
fn test_override_plugin_prefix_duplicates() { | |||
let configs = [ | |||
// FIXME: this should be valid | |||
// json!({ "@typescript-eslint/no-unused-vars": "error" }), | |||
json!({ "no-unused-vars": "off", "typescript/no-unused-vars": "error" }), | |||
json!({ "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "error" }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@typescript-eslint/no-unused-vars
does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is the rule: https://typescript-eslint.io/rules/no-unused-vars/
Internally we are remapping some eslint rules to typescript here:
oxc/crates/oxc_linter/src/utils/mod.rs
Lines 55 to 74 in d966e0a
// List of Eslint rules that have Typescript equivalents. | |
const TYPESCRIPT_COMPATIBLE_ESLINT_RULES: phf::Set<&'static str> = phf::phf_set! { | |
"class-methods-use-this", | |
"default-param-last", | |
"init-declarations", | |
"max-params", | |
"no-array-constructor", | |
"no-dupe-class-members", | |
"no-empty-function", | |
"no-invalid-this", | |
"no-loop-func", | |
"no-loss-of-precision", | |
"no-magic-numbers", | |
"no-redeclare", | |
"no-restricted-imports", | |
"no-shadow", | |
"no-unused-expressions", | |
"no-unused-vars", | |
"no-use-before-define", | |
"no-useless-constructor", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internally we are remapping some eslint rules to typescript here:
Got it.
json!({ "no-unused-vars": "off", "typescript/no-unused-vars": "error" }), | ||
json!({ "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "error" }), | ||
// json!({ "@unicorn-eslint/no-nested-ternary": "error" }), | ||
json!({ "no-nested-ternary": "off", "unicorn/no-nested-ternary": "error" }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"no-nested-ternary"
=> "eslint/no-nested-ternary"
Currently, we do not support rules without an explicit plugin_name, which would automatically match all rules:
"no-nested-ternary"
=> "eslint/no-nested-ternary"
and "unicorn/no-nested-ternary"
closes #8485
Since we currently support rules with the same
name
but differentplugins
, some of the original logic is no longer applicable. As a result, I have made some adjustments.