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

New Feature: Catch boolean assertions with equality comparisons #171

Closed
bmish opened this issue Apr 10, 2021 · 1 comment · Fixed by #173
Closed

New Feature: Catch boolean assertions with equality comparisons #171

bmish opened this issue Apr 10, 2021 · 1 comment · Fixed by #173

Comments

@bmish
Copy link
Collaborator

bmish commented Apr 10, 2021

Disallow and potentially autofix assertions like:

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

Solutions:

  1. Create rule new called no-boolean-equality. But this would be highly redundant with the no-ok-equality rule.
  2. Add new option checkBooleanAssertions to no-ok-equality (default false until next major version).

My preference is 2 to avoid creating a highly redundant new rule.

@platinumazure
Copy link
Owner

Similar to #170, I agree with doing option 2 for now, although long-term I do want to rename the rule.

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

Successfully merging a pull request may close this issue.

2 participants