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

Add checkBooleanAssertions option to no-ok-equality rule #173

Conversation

bmish
Copy link
Collaborator

@bmish bmish commented Apr 11, 2021

This adds a new option checkBooleanAssertions to the rule no-ok-equality.

The boolean assertions true/false are very similar to the ok/notOk assertions that are already checked by the rule.

Disallows and autofixes assertions like:

assert.true(foo === 1);
assert.false(foo !== 1);

We can enable the checkBooleanAssertions option by default in the next major release.

Fixes #171.

@coveralls
Copy link

coveralls commented Apr 11, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 54ec754 on bmish:no-ok-equality-checkBooleanAssertions into 8390fa7 on platinumazure:master.

@bmish bmish force-pushed the no-ok-equality-checkBooleanAssertions branch from d4cb68e to 54ec754 Compare April 11, 2021 22:40
@bmish bmish mentioned this pull request Apr 11, 2021
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 great, thanks for contributing!

@platinumazure platinumazure merged commit 291a6c1 into platinumazure:master Apr 22, 2021
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.

New Feature: Catch boolean assertions with equality comparisons
3 participants