-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
feat(linter): implement no-negated-condition
rule
#8149
base: main
Are you sure you want to change the base?
feat(linter): implement no-negated-condition
rule
#8149
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 #8149 will not alter performanceComparing Summary
|
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.
thanks for the work. I commented some possible improvements.
They are all probably only nitpicking :')
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.
👍 you can resolve the discussions (I do not have the rights for that ^^)
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.
i think we've already got this rule covered by the unicorn variant?
do you mind porting the test cases to there and seeing if the all pass correctly?
I added tests to the unicorn's rule, and they all passed. |
i haven't looked into #8009. but we shouldn't have the same code doing the same thing/ That said, it would be OK to map To clarify, we would change the following oxc/crates/oxc_linter/src/config/rules.rs Lines 159 to 161 in 3858221
to be something like: diff --git a/crates/oxc_linter/src/config/rules.rs b/crates/oxc_linter/src/config/rules.rs
index e661f876f..251026b5f 100644
--- a/crates/oxc_linter/src/config/rules.rs
+++ b/crates/oxc_linter/src/config/rules.rs
@@ -160,6 +160,10 @@ fn transform_rule_and_plugin_name<'a>(
return (rule_name, "eslint");
}
+ if plugin_name == "unicorn" && rule_name == "no-negated-condition" {
+ return ("no-negated-condition", "eslint");
+ }
+
(rule_name, plugin_name)
} that way, regardsless of whether you have |
i looked into #8009 briefly and i'm pretty sure it's unrelated to this. it's (possibly - although i couldn't reproduce it) a bug somewhere in our config code |
cd2d32e
to
24388b5
Compare
implement: https://eslint.org/docs/latest/rules/no-negated-condition