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

Fix no-compare-relation-boolean error when passing <2 args #234

Merged

Conversation

dwickern
Copy link
Contributor

@dwickern dwickern commented Jun 6, 2022

My editor runs eslint on every change to the source file. When I type assert.strictEqual(, the editor autofills the closing paren. Then eslint crashes on the no-compare-relation-boolean rule with the error:

TypeError: Cannot read properties of undefined (reading 'type')

Copy link
Owner

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

Tests look good. I think the logic is incorrect and causing failing tests at the moment so I left a note where I think the change needs to be, but let me know if I'm wrong.

lib/rules/no-compare-relation-boolean.js Outdated Show resolved Hide resolved
@platinumazure
Copy link
Owner

Thanks for this! We definitely want to avoid a crash if at all possible.

@coveralls
Copy link

coveralls commented Jun 8, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling b024a13 on dwickern:fix-no-compare-relation-boolean into 23fa36d on platinumazure:master.

Copy link
Owner

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@platinumazure platinumazure merged commit f25a525 into platinumazure:master Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants