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

Consider qunit/no-assert-equal-boolean #366

Open
edg2s opened this issue Mar 25, 2021 · 6 comments
Open

Consider qunit/no-assert-equal-boolean #366

edg2s opened this issue Mar 25, 2021 · 6 comments

Comments

@edg2s
Copy link
Member

edg2s commented Mar 25, 2021

This rules suggests assert.true( foo ) over assert.strictEqual( foo, true ):
https://github.com/platinumazure/eslint-plugin-qunit/blob/master/docs/rules/no-assert-equal-boolean.md

Both check for a strict equality to true.

@edg2s
Copy link
Member Author

edg2s commented Mar 25, 2021

Personally I'm not sure assert.true adds much value. It is not immediately obvious that assert.true is strict.

@jdforrester
Copy link
Member

We did the equivalent of this for phpunit in mediawiki-codesniffer recently.

@jdforrester
Copy link
Member

(But that's with strict typing, as you point out.)

edg2s added a commit that referenced this issue Mar 25, 2021
Enables:
* no-async-module-callbacks
* no-compare-relation-boolean
* no-hooks-from-ancestor-modules
* no-nested-tests
* require-object-in-propequal

Disables:
* no-arrow-tests
* no-assert-equal-boolean (#366)
@edg2s
Copy link
Member Author

edg2s commented Mar 25, 2021

What happened in codesniffer?

@edg2s
Copy link
Member Author

edg2s commented Mar 25, 2021

The above patch will not enable this rule, but will disallow assert.strictEqual( x > 5, true ) in favour of assert.ok( x > 5 )

jdforrester pushed a commit that referenced this issue Mar 25, 2021
Enables:
* no-async-module-callbacks
* no-compare-relation-boolean
* no-hooks-from-ancestor-modules
* no-nested-tests
* require-object-in-propequal

Disables:
* no-arrow-tests
* no-assert-equal-boolean (#366)
@jdforrester
Copy link
Member

Shall we say that this is good enough and mark this as Resolved?

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

No branches or pull requests

2 participants