Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_analyze): don't check double negation in noNegationElse #3491

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

ematipico
Copy link
Contributor

Summary

Closes #3141

Test Plan

Added a new test case from the issue that was filed

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit be79e8a
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/635a66bb92cda2000860e7b9

@ematipico ematipico temporarily deployed to netlify-playground October 26, 2022 08:05 Inactive
@github-actions
Copy link

github-actions bot commented Oct 26, 2022

@ematipico ematipico temporarily deployed to netlify-playground October 27, 2022 11:08 Inactive
@ematipico ematipico merged commit f2fc482 into main Oct 27, 2022
@ematipico ematipico deleted the fix/no-negation-else branch October 27, 2022 12:18
(
Some(JsUnaryOperator::LogicalNot),
Some(JsAnyExpression::JsUnaryExpression(_)),
) => Some(false),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be checking the operator of the inner unary expression is also LogicalNot, otherwise the rule will miss cases like !-a ? b : c

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will follow up with another PR. Thank you for the review!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 noNegationElse is not considering double negation
3 participants