Skip to content

Commit 9ee61a4

Browse files
committed
ESLint: Explicitly configure unicorn/explicit-length-check rule
1 parent 12e5b52 commit 9ee61a4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module.exports = {
3838
'ember-concurrency/no-perform-without-catch': 'warn',
3939
'ember-concurrency/require-task-name-suffix': 'error',
4040

41+
'unicorn/explicit-length-check': ['error', { 'non-zero': 'not-equal' }],
4142
// disabled because we need `null` since JSON has no `undefined`
4243
'unicorn/no-null': 'off',
4344
// disabled because this rule conflicts with prettier

app/controllers/crate/version.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default class CrateVersionController extends Controller {
8181
versions.push(version.getProperties('id', 'num'));
8282
});
8383
}
84-
if (extra.length > 0) {
84+
if (extra.length !== 0) {
8585
versions.push({
8686
id: null,
8787
num: 'Other',
@@ -136,7 +136,7 @@ export default class CrateVersionController extends Controller {
136136
// if we know about a successful docs.rs build, we'll return a link to that
137137
if (this.loadDocsBuildsTask.lastSuccessful) {
138138
let docsBuilds = this.loadDocsBuildsTask.lastSuccessful.value;
139-
if (docsBuilds.length > 0 && docsBuilds[0].build_status === true) {
139+
if (docsBuilds.length !== 0 && docsBuilds[0].build_status === true) {
140140
return `https://docs.rs/${this.crate.name}/${this.currentVersion.num}`;
141141
}
142142
}

0 commit comments

Comments
 (0)