From 5b17a70e8b4afe8e563b3b66216329cfb4d1a55f Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 6 May 2020 18:06:42 +0100 Subject: [PATCH] Update dependency eslint-plugin-ghost to v1.4.0 no issue - applies fixes for new/updated rules - disables `ember/no-mixins` rule as we're not able to migrate away yet --- ghost/admin/.eslintrc.js | 1 + .../admin/app/components/gh-members-chart.js | 2 +- ghost/admin/app/controllers/members.js | 2 +- ghost/admin/app/mixins/validation-state.js | 1 + ghost/admin/app/models/post.js | 1 + ghost/admin/package.json | 2 +- .../unit/mixins/validation-engine-test.js | 7 --- ghost/admin/yarn.lock | 43 ++++++++++--------- 8 files changed, 28 insertions(+), 31 deletions(-) diff --git a/ghost/admin/.eslintrc.js b/ghost/admin/.eslintrc.js index bf307d5a20..d1cbda6cc9 100644 --- a/ghost/admin/.eslintrc.js +++ b/ghost/admin/.eslintrc.js @@ -20,6 +20,7 @@ module.exports = { 'ghost/ember/use-ember-get-and-set': 'off', // disable linting of mixins until we migrate away + 'ghost/ember/no-mixins': 'off', 'ghost/ember/no-new-mixins': 'off' } }; diff --git a/ghost/admin/app/components/gh-members-chart.js b/ghost/admin/app/components/gh-members-chart.js index 176d0d46f8..6f8a4e7ac2 100644 --- a/ghost/admin/app/components/gh-members-chart.js +++ b/ghost/admin/app/components/gh-members-chart.js @@ -33,7 +33,7 @@ export default Component.extend({ ]; }), - subData: computed('members.@each', 'range', 'feature.nightShift', function () { + subData: computed('members.[]', 'range', 'feature.nightShift', function () { let isNightShiftEnabled = this.feature.nightShift; let {members, range} = this; let rangeInDays, rangeStartDate, rangeEndDate; diff --git a/ghost/admin/app/controllers/members.js b/ghost/admin/app/controllers/members.js index 8ce34aa119..ad0c52d034 100644 --- a/ghost/admin/app/controllers/members.js +++ b/ghost/admin/app/controllers/members.js @@ -57,7 +57,7 @@ export default Controller.extend({ return !searchText && !label; }), - availableLabels: computed('_availableLabels.@each.{isNew}', function () { + availableLabels: computed('_availableLabels.@each.isNew', function () { let labels = this._availableLabels .filter(label => !label.get('isNew')) .filter(label => label.get('id') !== null) diff --git a/ghost/admin/app/mixins/validation-state.js b/ghost/admin/app/mixins/validation-state.js index b28e8c74ae..e53e566ff3 100644 --- a/ghost/admin/app/mixins/validation-state.js +++ b/ghost/admin/app/mixins/validation-state.js @@ -1,6 +1,7 @@ import Mixin from '@ember/object/mixin'; import {A as emberA} from '@ember/array'; import {isEmpty} from '@ember/utils'; +// eslint-disable-next-line ghost/ember/no-observers import {observer} from '@ember/object'; import {on} from '@ember/object/evented'; import {run} from '@ember/runloop'; diff --git a/ghost/admin/app/models/post.js b/ghost/admin/app/models/post.js index 689e3b6dff..492ee0ba16 100644 --- a/ghost/admin/app/models/post.js +++ b/ghost/admin/app/models/post.js @@ -4,6 +4,7 @@ import ValidationEngine from 'ghost-admin/mixins/validation-engine'; import boundOneWay from 'ghost-admin/utils/bound-one-way'; import moment from 'moment'; import {compare} from '@ember/utils'; +// eslint-disable-next-line ghost/ember/no-observers import {computed, observer} from '@ember/object'; import {equal, filterBy, reads} from '@ember/object/computed'; import {isBlank} from '@ember/utils'; diff --git a/ghost/admin/package.json b/ghost/admin/package.json index 288ff8b944..177d85b025 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -101,7 +101,7 @@ "ember-useragent": "0.9.1", "emberx-file-input": "1.2.1", "eslint": "6.8.0", - "eslint-plugin-ghost": "1.0.0", + "eslint-plugin-ghost": "1.4.0", "faker": "4.1.0", "fs-extra": "9.0.0", "glob": "7.1.6", diff --git a/ghost/admin/tests/unit/mixins/validation-engine-test.js b/ghost/admin/tests/unit/mixins/validation-engine-test.js index 7cbe332cfe..6d0acc3d0d 100644 --- a/ghost/admin/tests/unit/mixins/validation-engine-test.js +++ b/ghost/admin/tests/unit/mixins/validation-engine-test.js @@ -7,13 +7,6 @@ import { // import ValidationEngineMixin from 'ghost-admin/mixins/validation-engine'; describe('ValidationEngineMixin', function () { - // Replace this with your real tests. - // it('works', function () { - // var ValidationEngineObject = EmberObject.extend(ValidationEngineMixin); - // var subject = ValidationEngineObject.create(); - // expect(subject).to.be.ok; - // }); - describe('#validate', function () { it('loads the correct validator'); it('rejects if the validator doesn\'t exist'); diff --git a/ghost/admin/yarn.lock b/ghost/admin/yarn.lock index 746b418e39..92bdaa2814 100644 --- a/ghost/admin/yarn.lock +++ b/ghost/admin/yarn.lock @@ -6440,14 +6440,14 @@ eslint-module-utils@^2.4.1: debug "^2.6.9" pkg-dir "^2.0.0" -eslint-plugin-ember@7.7.2: - version "7.7.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-ember/-/eslint-plugin-ember-7.7.2.tgz#ba4afe59e7b2efdfbb85bc16484c95aaa45b8392" - integrity sha512-Ua7+xePz8m0BrqSHfYibkRXWQMMb5RBsH9ohZy2a7ri+s6+UQre9x3BxPpawCLZMzQzIG4vQh93YiVGCSv3XYA== +eslint-plugin-ember@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-ember/-/eslint-plugin-ember-8.5.0.tgz#08660485edcf78c716b7db7c0834c970d06a3dc1" + integrity sha512-tj8GQbm5XknbUDp4FrwMLGBprxqzoi9JAszXyCwMPJQBipinHyyAxIRbu57/ENJVyeGRmQTme1WM4PJuMh3kFQ== dependencies: "@ember-data/rfc395-data" "^0.0.4" ember-rfc176-data "^0.3.12" - snake-case "^3.0.2" + snake-case "^3.0.3" eslint-plugin-es@^3.0.0: version "3.0.0" @@ -6457,13 +6457,13 @@ eslint-plugin-es@^3.0.0: eslint-utils "^2.0.0" regexpp "^3.0.0" -eslint-plugin-ghost@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-ghost/-/eslint-plugin-ghost-1.0.0.tgz#71bd8fb204e3614fd5e9d19fadd618a80f8444c4" - integrity sha512-oeI0Sq9RwEvfmlQmT9iJuxwDhEBWKvscgixkgDQhk1YCoMNCE5a+p8cRbUmCwRShtdiHH3mB8LUUZ4s5k6GwKw== +eslint-plugin-ghost@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-ghost/-/eslint-plugin-ghost-1.4.0.tgz#cef5ce7779e3f174e9c9b267d9e9b48256750fa2" + integrity sha512-cLeyUfUIlLLBtFJyyPIgxQ0D9UzR3dwRpmGApKnJdlWoXvnc3HElvAPK3qZO9VhSyJQNgGIAd6F0ATIieFXz8w== dependencies: - eslint-plugin-ember "7.7.2" - eslint-plugin-mocha "6.2.2" + eslint-plugin-ember "8.5.0" + eslint-plugin-mocha "6.3.0" eslint-plugin-sort-imports-es6-autofix "0.5.0" eslint-plugin-import@^2.20.1: @@ -6484,12 +6484,13 @@ eslint-plugin-import@^2.20.1: read-pkg-up "^2.0.0" resolve "^1.12.0" -eslint-plugin-mocha@6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-6.2.2.tgz#6ef4b78bd12d744beb08a06e8209de330985100d" - integrity sha512-oNhPzfkT6Q6CJ0HMVJ2KLxEWG97VWGTmuHOoRcDLE0U88ugUyFNV9wrT2XIt5cGtqc5W9k38m4xTN34L09KhBA== +eslint-plugin-mocha@6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-6.3.0.tgz#72bfd06a5c4323e17e30ef41cd726030e8cdb8fd" + integrity sha512-Cd2roo8caAyG21oKaaNTj7cqeYRWW1I2B5SfpKRp0Ip1gkfwoR1Ow0IGlPWnNjzywdF4n+kHL8/9vM6zCJUxdg== dependencies: - ramda "^0.26.1" + eslint-utils "^2.0.0" + ramda "^0.27.0" eslint-plugin-node@^11.0.0: version "11.1.0" @@ -11357,10 +11358,10 @@ raf-pool@0.1.0: resolved "https://registry.yarnpkg.com/raf-pool/-/raf-pool-0.1.0.tgz#856242f3d66b45ee0d4a9159d05d8560614891b3" integrity sha512-TU79Jf8D0OsPlEPegLmx4O/Az3I2qm3TZnHEZE+fUJ/aeVf46m/HDRV5lHrdRQ9m3PhodfwFVwmMz/BgUXEppg== -ramda@^0.26.1: - version "0.26.1" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" - integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== +ramda@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.0.tgz#915dc29865c0800bf3f69b8fd6c279898b59de43" + integrity sha512-pVzZdDpWwWqEVVLshWUHjNwuVP7SfcmPraYuqocJp1yo2U1R7P+5QAfDhdItkuoGqIBnBYrtPp7rEPqDn9HlZA== randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: version "2.1.0" @@ -12225,7 +12226,7 @@ slice-ansi@^2.1.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" -snake-case@^3.0.2: +snake-case@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.3.tgz#c598b822ab443fcbb145ae8a82c5e43526d5bbee" integrity sha512-WM1sIXEO+rsAHBKjGf/6R1HBBcgbncKS08d2Aqec/mrDSpU80SiOU41hO7ny6DToHSyrlwTYzQBIK1FPSx4Y3Q==