Skip to content
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

misc(lint): enable no-conditional-assignment rule #14757

Merged
merged 1 commit into from
Feb 7, 2023
Merged

Conversation

paulirish
Copy link
Member

https://eslint.org/docs/latest/rules/no-cond-assign

I lost 30 minutes of debugging to this situation a few months back. (= instead of === in a conditional.)
it now haunts me.

it's part of eslint:recommended, but eslint-config-google flips it back off: https://github.com/google/eslint-config-google/blob/master/index.js#L37

also.. the google config was archived last month! huh. bummer.

@paulirish paulirish requested a review from a team as a code owner February 6, 2023 21:58
@paulirish paulirish requested review from adamraine and removed request for a team February 6, 2023 21:58
@paulirish paulirish added the P3 label Feb 6, 2023
@@ -265,7 +265,7 @@ function getNodePath(node) {
}
let index = 0;
let prevNode;
while (prevNode = node.previousSibling) {
while (prevNode = node.previousSibling) { // eslint-disable-line no-cond-assign
Copy link
Member

Choose a reason for hiding this comment

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

If we're going to enable this rule, we should try and stick to it.

There are other ways of organizing this code.

@connorjclark connorjclark merged commit 69e62cf into main Feb 7, 2023
@connorjclark connorjclark deleted the no-cond-assign branch February 7, 2023 22:29
@adamraine
Copy link
Member

😑

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

Successfully merging this pull request may close these issues.

4 participants