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

Breaking: Add no-assert-equal to recommended config #194

Merged
merged 5 commits into from
Aug 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Each rule has emojis denoting:
| [assert-args](./docs/rules/assert-args.md) | enforce that the correct number of assert arguments are used | :white_check_mark: | | |
| [literal-compare-order](./docs/rules/literal-compare-order.md) | enforce comparison assertions have arguments in the right order | :white_check_mark: | :wrench: | |
| [no-arrow-tests](./docs/rules/no-arrow-tests.md) | disallow arrow functions as QUnit test/module callbacks | :white_check_mark: | :wrench: | |
| [no-assert-equal](./docs/rules/no-assert-equal.md) | disallow the use of assert.equal | | | 💡 |
| [no-assert-equal](./docs/rules/no-assert-equal.md) | disallow the use of assert.equal | :white_check_mark: | | 💡 |
| [no-assert-equal-boolean](./docs/rules/no-assert-equal-boolean.md) | require use of boolean assertions | :white_check_mark: | :wrench: | |
| [no-assert-logical-expression](./docs/rules/no-assert-logical-expression.md) | disallow binary logical expressions in assert arguments | :white_check_mark: | | |
| [no-assert-ok](./docs/rules/no-assert-ok.md) | disallow the use of assert.ok/assert.notOk | | | |
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-assert-equal.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Disallow the use of assert.equal (no-assert-equal)

:white_check_mark: The `"extends": "plugin:qunit/recommended"` property in a configuration file enables this rule.

💡 Some problems reported by this rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

The `assert.equal` assertion method in QUnit uses loose equality comparison. In a project which favors strict equality comparison, it is better to use `assert.strictEqual` for scalar values and either `assert.deepEqual` or `assert.propEqual` for more complex objects.
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
"qunit/assert-args": "error",
"qunit/literal-compare-order": "error",
"qunit/no-arrow-tests": "error",
"qunit/no-assert-equal": "error",
"qunit/no-assert-equal-boolean": "error",
"qunit/no-assert-logical-expression": "error",
"qunit/no-async-in-loops": "error",
Expand Down