feat(linter): implement no-negated-condition rule#8149
feat(linter): implement no-negated-condition rule#8149camc314 merged 9 commits intooxc-project:mainfrom
no-negated-condition rule#8149Conversation
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
|
Sysix
left a comment
There was a problem hiding this comment.
thanks for the work. I commented some possible improvements.
They are all probably only nitpicking :')
Sysix
left a comment
There was a problem hiding this comment.
👍 you can resolve the discussions (I do not have the rights for that ^^)
camc314
left a comment
There was a problem hiding this comment.
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