Skip to content

Commit

Permalink
Build: Enable strict eqeqeq rule always
Browse files Browse the repository at this point in the history
Previously, the inherited config from eslint-config-standard enabled
the rule, but it sets an exemption for loose equality with null [1].

The instance in html.js will be fixed in a separate patch since that
actually obscured a bug.

[0]: https://eslint.org/docs/latest/rules/eqeqeq
[1]: https://github.com/standard/eslint-config-standard/blob/v17.1.0/.eslintrc.json#L61
  • Loading branch information
Krinkle committed Jun 12, 2024
1 parent d38e5ed commit 0ed714c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const config = Object.assign(standard, {
'prefer-const': 'off',
'prefer-promise-reject-errors': 'off',
// extra
eqeqeq: ['error'],
'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }]
})
});
Expand Down
1 change: 1 addition & 0 deletions src/html-reporter/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ const stats = {
}
} else {
let test;
// eslint-disable-next-line eqeqeq
while ((test = hiddenTests.pop()) != null) {
tests.appendChild(test);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ Test.prototype = {
},

resolvePromise: function (promise, phase) {
if (promise != null) {
if (promise !== undefined && promise !== null) {
const test = this;
const then = promise.then;
if (typeof then === 'function') {
Expand Down

0 comments on commit 0ed714c

Please sign in to comment.