From 4ae915192352aa50327aa5748ea271567f123f4f Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 22 Jul 2019 11:15:33 +0100 Subject: [PATCH] Fix linting errors refs https://github.com/TryGhost/Ghost-Admin/pull/1274 - fixes errors introduced from upgrading to eslint@6 --- ghost/admin/app/components/gh-image-uploader.js | 1 - ghost/admin/app/controllers/editor.js | 1 - ghost/admin/app/controllers/settings/labs.js | 6 +----- ghost/admin/app/utils/password-generator.js | 2 +- ghost/admin/mirage/config/authentication.js | 1 - 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/ghost/admin/app/components/gh-image-uploader.js b/ghost/admin/app/components/gh-image-uploader.js index ba6060ac04..22546107c7 100644 --- a/ghost/admin/app/components/gh-image-uploader.js +++ b/ghost/admin/app/components/gh-image-uploader.js @@ -122,7 +122,6 @@ export default Component.extend({ fileSelected(fileList, resetInput) { // can't use array destructuring here as FileList is not a strict // array and fails in Safari - // eslint-disable-next-line ember-suave/prefer-destructuring let file = fileList[0]; let validationResult = this._validate(file); diff --git a/ghost/admin/app/controllers/editor.js b/ghost/admin/app/controllers/editor.js index 280176603e..412f61c8d5 100644 --- a/ghost/admin/app/controllers/editor.js +++ b/ghost/admin/app/controllers/editor.js @@ -772,7 +772,6 @@ export default Controller.extend({ let errorMessage; function isString(str) { - /* global toString */ return toString.call(str) === '[object String]'; } diff --git a/ghost/admin/app/controllers/settings/labs.js b/ghost/admin/app/controllers/settings/labs.js index 15cd507bc3..963b69df34 100644 --- a/ghost/admin/app/controllers/settings/labs.js +++ b/ghost/admin/app/controllers/settings/labs.js @@ -296,11 +296,7 @@ export default Controller.extend({ }).drop(), saveSettings: task(function* () { - try { - return yield this.settings.save(); - } catch (error) { - throw error; - } + return yield this.settings.save(); }).drop(), redirectUploadResult: task(function* (success) { diff --git a/ghost/admin/app/utils/password-generator.js b/ghost/admin/app/utils/password-generator.js index 68e517ac6e..62b8f66252 100644 --- a/ghost/admin/app/utils/password-generator.js +++ b/ghost/admin/app/utils/password-generator.js @@ -15,7 +15,7 @@ function rand(min, max) { var key, value, arr = new Uint8Array(max); getRandomValues(arr); for (key in arr) { - if (arr.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(arr, key)) { value = arr[key]; if (value > min && value < max) { return value; diff --git a/ghost/admin/mirage/config/authentication.js b/ghost/admin/mirage/config/authentication.js index a87718185e..472ab83b16 100644 --- a/ghost/admin/mirage/config/authentication.js +++ b/ghost/admin/mirage/config/authentication.js @@ -10,7 +10,6 @@ export default function mockAuthentication(server) { server.post('/authentication/passwordreset', function (schema, request) { let {passwordreset} = JSON.parse(request.requestBody); - // eslint-disable-next-line ember-suave/prefer-destructuring let email = passwordreset[0].email; if (email === 'unknown@example.com') {