-
Notifications
You must be signed in to change notification settings - Fork 667
feat(rome_js_analyze): new rule noCondAssign #3750
Conversation
✅ Deploy Preview for docs-rometools ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
Nice to see how straightforward the implementation is thanks to the separation of expression/assignments in the AST.
Should this rule be named
CC: @ematipico @leops |
!bench_analyzer |
Analyzer Benchmark Results
|
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.
Given the nature of the rule, I think we could provide a suggested fix to replace the assignment expression with a ===
binary expression
It could be incorrect in some cases. do {} while (node = node.next) Suggesting the below seem bad: do {} while (node === node.next) |
I think that's acceptable as long it's only a "suggested fix" with |
@leops Is it ok if I take it up in a followup PR? |
Sure yes let's get this merged first |
Summary
Implement eslint's
no-cond-assign
lint.Test Plan
Added unit tests.