Skip to content

Update dependency eslint-plugin-unicorn to v25 #3135

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

Merged
merged 3 commits into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
'ember-concurrency/no-perform-without-catch': 'warn',
'ember-concurrency/require-task-name-suffix': 'error',

'unicorn/explicit-length-check': ['error', { 'non-zero': 'not-equal' }],
// disabled because we need `null` since JSON has no `undefined`
'unicorn/no-null': 'off',
// disabled because this rule conflicts with prettier
Expand Down Expand Up @@ -84,7 +85,7 @@ module.exports = {
files: ['mirage/**/*.js'],
rules: {
// disabled because of different `.find()` meaning
'unicorn/no-fn-reference-in-iterator': 'off',
'unicorn/no-array-callback-reference': 'off',
},
},

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/crate/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class CrateVersionController extends Controller {
versions.push(version.getProperties('id', 'num'));
});
}
if (extra.length > 0) {
if (extra.length !== 0) {
versions.push({
id: null,
num: 'Other',
Expand Down Expand Up @@ -136,7 +136,7 @@ export default class CrateVersionController extends Controller {
// if we know about a successful docs.rs build, we'll return a link to that
if (this.loadDocsBuildsTask.lastSuccessful) {
let docsBuilds = this.loadDocsBuildsTask.lastSuccessful.value;
if (docsBuilds.length > 0 && docsBuilds[0].build_status === true) {
if (docsBuilds.length !== 0 && docsBuilds[0].build_status === true) {
return `https://docs.rs/${this.crate.name}/${this.currentVersion.num}`;
}
}
Expand Down
2 changes: 1 addition & 1 deletion mirage/route-handlers/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function summary(schema) {
let most_recently_downloaded = crates.sort((a, b) => b.recent_downloads - a.recent_downloads).slice(0, 10);

let num_crates = crates.length;
// eslint-disable-next-line unicorn/no-reduce
// eslint-disable-next-line unicorn/no-array-reduce
let num_downloads = crates.models.reduce((sum, crate) => sum + crate.downloads, 0);

let popular_categories = schema.categories
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"eslint-plugin-ember-concurrency": "0.2.1",
"eslint-plugin-import-helpers": "1.1.0",
"eslint-plugin-prettier": "3.3.0",
"eslint-plugin-unicorn": "24.0.0",
"eslint-plugin-unicorn": "25.0.0",
"loader.js": "4.7.0",
"normalize.css": "8.0.1",
"nyc": "15.1.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7390,10 +7390,10 @@ [email protected]:
dependencies:
prettier-linter-helpers "^1.0.0"

eslint-plugin-unicorn@24.0.0:
version "24.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-24.0.0.tgz#08017ccd7ac704777d459cff6e13a35f54cbcab1"
integrity sha512-NfLjIZas/ZUwc3S+pUtbTRqgCkODxPEkJBJ5ZR8wIu90BmX4jmXp10hoOZMScR2CR1NYTtrx0OX4BQvBnbzZzA==
eslint-plugin-unicorn@25.0.0:
version "25.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-25.0.0.tgz#b5718381ac615f2bcf7814e4acf0aac78b11a10f"
integrity sha512-RuhPUrsKuRj0YGz8lMuh5Z5DJoC/hmUR6omvlquLlY6SYY+oZXMFyp83ckpqLMhbafqUx+JttWOPOjfP4W9Y+Q==
dependencies:
ci-info "^2.0.0"
clean-regexp "^1.0.0"
Expand Down