Updated Eslint ECMAScript compatibility to 2022

refs https://github.com/TryGhost/Toolbox/issues/345

- this commit bumps `eslint-plugin-ghost`, which bumps compatiblity to
  2022
- this also removes a lot of the manually-added
  `parserOptions.ecmaVersion` that we had in imported packages, in favor
  of the value set in `eslint-plugin-ghost`
This commit is contained in:
Daniel Lockyer 2022-08-09 15:48:33 +02:00
parent 63fc06da28
commit 6dde5e40e3
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD
13 changed files with 40 additions and 58 deletions

View File

@ -3,7 +3,6 @@ module.exports = {
root: true, root: true,
parser: '@babel/eslint-parser', parser: '@babel/eslint-parser',
parserOptions: { parserOptions: {
ecmaVersion: 2018,
sourceType: 'module', sourceType: 'module',
allowImportExportEverywhere: false, allowImportExportEverywhere: false,
ecmaFeatures: { ecmaFeatures: {

View File

@ -123,7 +123,6 @@
"emberx-file-input": "1.2.1", "emberx-file-input": "1.2.1",
"eslint": "8.21.0", "eslint": "8.21.0",
"eslint-plugin-babel": "5.3.1", "eslint-plugin-babel": "5.3.1",
"eslint-plugin-ghost": "2.14.0",
"eslint-plugin-react": "7.30.1", "eslint-plugin-react": "7.30.1",
"faker": "5.5.3", "faker": "5.5.3",
"fs-extra": "10.1.0", "fs-extra": "10.1.0",
@ -177,4 +176,4 @@
"path-browserify": "1.0.1", "path-browserify": "1.0.1",
"webpack": "5.74.0" "webpack": "5.74.0"
} }
} }

View File

@ -5,9 +5,6 @@ module.exports = {
es6: true, es6: true,
node: true node: true
}, },
parserOptions: {
ecmaVersion: 2020
},
plugins: ['ghost'], plugins: ['ghost'],
extends: [ extends: [
'plugin:ghost/node' 'plugin:ghost/node'

View File

@ -196,7 +196,6 @@
"cli-progress": "3.11.2", "cli-progress": "3.11.2",
"cssnano": "5.1.12", "cssnano": "5.1.12",
"eslint": "8.21.0", "eslint": "8.21.0",
"eslint-plugin-ghost": "2.14.0",
"grunt": "1.5.3", "grunt": "1.5.3",
"grunt-contrib-symlink": "1.0.0", "grunt-contrib-symlink": "1.0.0",
"grunt-shell": "4.0.0", "grunt-shell": "4.0.0",

View File

@ -1,7 +1,4 @@
module.exports = { module.exports = {
parserOptions: {
ecmaVersion: 2022
},
plugins: ['ghost'], plugins: ['ghost'],
extends: [ extends: [
'plugin:ghost/node' 'plugin:ghost/node'

View File

@ -1,7 +1,4 @@
module.exports = { module.exports = {
parserOptions: {
ecmaVersion: 2017
},
plugins: ['ghost'], plugins: ['ghost'],
extends: [ extends: [
'plugin:ghost/test' 'plugin:ghost/test'

View File

@ -2,9 +2,5 @@ module.exports = {
plugins: ['ghost'], plugins: ['ghost'],
extends: [ extends: [
'plugin:ghost/test' 'plugin:ghost/test'
], ]
// TODO: why is this needed for async/await? Check eslint-plugin-ghost
parserOptions: {
ecmaVersion: 2017
}
}; };

View File

@ -2,8 +2,5 @@ module.exports = {
plugins: ['ghost'], plugins: ['ghost'],
extends: [ extends: [
'plugin:ghost/test' 'plugin:ghost/test'
], ]
parserOptions: {
ecmaVersion: 2017
}
}; };

View File

@ -1,7 +1,4 @@
module.exports = { module.exports = {
parserOptions: {
ecmaVersion: 2022
},
plugins: ['ghost'], plugins: ['ghost'],
extends: [ extends: [
'plugin:ghost/node' 'plugin:ghost/node'

View File

@ -2,8 +2,5 @@ module.exports = {
plugins: ['ghost'], plugins: ['ghost'],
extends: [ extends: [
'plugin:ghost/test' 'plugin:ghost/test'
], ]
parserOptions: {
ecmaVersion: 2017
}
}; };

View File

@ -1,7 +1,4 @@
module.exports = { module.exports = {
parserOptions: {
ecmaVersion: 2022
},
plugins: ['ghost'], plugins: ['ghost'],
extends: [ extends: [
'plugin:ghost/node' 'plugin:ghost/node'

View File

@ -78,22 +78,31 @@
}, },
{ {
"groupName": "ember-basic-dropdown addons", "groupName": "ember-basic-dropdown addons",
"packagePatterns": ["^ember-basic", "^ember-power"] "packagePatterns": [
"^ember-basic",
"^ember-power"
]
}, },
{ {
"groupName": "ember core", "groupName": "ember core",
"packageNames": ["ember-source", "ember-cli", "ember-data"] "packageNames": [
"ember-source",
"ember-cli",
"ember-data"
]
}, },
{ {
"groupName": "disable css", "groupName": "disable css",
"matchFiles": ["ghost/admin/package.json"], "matchFiles": [
"ghost/admin/package.json"
],
"packagePatterns": [ "packagePatterns": [
"^postcss", "^postcss",
"^css" "^css"
], ],
"packageNames": [ "packageNames": [
"autoprefixer", "autoprefixer",
"ember-cli-postcss" "ember-cli-postcss"
], ],
"enabled": false "enabled": false
} }
@ -101,6 +110,7 @@
}, },
"devDependencies": { "devDependencies": {
"concurrently": "7.3.0", "concurrently": "7.3.0",
"eslint-plugin-ghost": "2.15.0",
"nodemon": "2.0.19" "nodemon": "2.0.19"
} }
} }

View File

@ -882,7 +882,7 @@
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz#181f22d28ebe1b3857fa575f5c290b1aaf659b56" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz#181f22d28ebe1b3857fa575f5c290b1aaf659b56"
integrity sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw== integrity sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==
"@babel/helper-validator-identifier@^7.15.7", "@babel/helper-validator-identifier@^7.18.6": "@babel/helper-validator-identifier@^7.18.6":
version "7.18.6" version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076"
integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g== integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==
@ -7383,7 +7383,7 @@ ci-info@^2.0.0:
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
ci-info@^3.2.0, ci-info@^3.3.0, ci-info@^3.3.2: ci-info@^3.2.0, ci-info@^3.3.2:
version "3.3.2" version "3.3.2"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.2.tgz#6d2967ffa407466481c6c90b6e16b3098f080128" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.2.tgz#6d2967ffa407466481c6c90b6e16b3098f080128"
integrity sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg== integrity sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==
@ -10862,10 +10862,10 @@ eslint-plugin-babel@5.3.1:
dependencies: dependencies:
eslint-rule-composer "^0.3.0" eslint-rule-composer "^0.3.0"
eslint-plugin-ember@10.6.1: eslint-plugin-ember@11.0.5:
version "10.6.1" version "11.0.5"
resolved "https://registry.yarnpkg.com/eslint-plugin-ember/-/eslint-plugin-ember-10.6.1.tgz#04ea84cc82307f64a2faa4f2855b30e5ebf9f722" resolved "https://registry.yarnpkg.com/eslint-plugin-ember/-/eslint-plugin-ember-11.0.5.tgz#b4a1ce7df123e6b2d18c148b9340e62d32bc6b98"
integrity sha512-R+TN3jwhYQ2ytZCA1VkfJDZSGgHFOHjsHU1DrBlRXYRepThe56PpuGxywAyDvQ7inhoAz3e6G6M60PzpvjzmNg== integrity sha512-Hc6aQ6lsdjf9xPrgO0rRY5EjTSIssUEJ4IJZU+idtexead0DX1C5hZDgG9XTKYQIYwRR3JFFC5R4h6KOPCcQRQ==
dependencies: dependencies:
"@ember-data/rfc395-data" "^0.0.4" "@ember-data/rfc395-data" "^0.0.4"
css-tree "^2.0.4" css-tree "^2.0.4"
@ -10894,18 +10894,18 @@ eslint-plugin-filenames@1.3.2:
lodash.snakecase "4.1.1" lodash.snakecase "4.1.1"
lodash.upperfirst "4.3.1" lodash.upperfirst "4.3.1"
eslint-plugin-ghost@2.14.0: eslint-plugin-ghost@2.15.0:
version "2.14.0" version "2.15.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-ghost/-/eslint-plugin-ghost-2.14.0.tgz#cabfa6910f5f2053954dbad5f6ea3a8828035c36" resolved "https://registry.yarnpkg.com/eslint-plugin-ghost/-/eslint-plugin-ghost-2.15.0.tgz#cf6ae1cf7431fc81b55bd43855aa3984559addd8"
integrity sha512-vccwznFPJvZdPZmgq9GyBkPtf6hrharOYf8jny4s6H28mTv65TB02lxY5GTLBqA5FvgSsXPYTPXxIFp+V5n/nw== integrity sha512-1uYoDnrlZYm2dO6cm6g/Hq86VUIe+RmH5b6LC1B78bOjT9hAwgw1GcZaTz2R1YQTKjjr87Lep0r/KK5hJLub4g==
dependencies: dependencies:
"@kapouer/eslint-plugin-no-return-in-loop" "1.0.0" "@kapouer/eslint-plugin-no-return-in-loop" "1.0.0"
eslint-plugin-ember "10.6.1" eslint-plugin-ember "11.0.5"
eslint-plugin-filenames "1.3.2" eslint-plugin-filenames "1.3.2"
eslint-plugin-mocha "7.0.1" eslint-plugin-mocha "7.0.1"
eslint-plugin-node "11.1.0" eslint-plugin-node "11.1.0"
eslint-plugin-sort-imports-es6-autofix "0.6.0" eslint-plugin-sort-imports-es6-autofix "0.6.0"
eslint-plugin-unicorn "42.0.0" eslint-plugin-unicorn "43.0.2"
eslint-plugin-mocha@7.0.1: eslint-plugin-mocha@7.0.1:
version "7.0.1" version "7.0.1"
@ -10952,13 +10952,13 @@ eslint-plugin-sort-imports-es6-autofix@0.6.0:
resolved "https://registry.yarnpkg.com/eslint-plugin-sort-imports-es6-autofix/-/eslint-plugin-sort-imports-es6-autofix-0.6.0.tgz#b8cd8639d7a54cefce6b17898b102fd5ec31e52b" resolved "https://registry.yarnpkg.com/eslint-plugin-sort-imports-es6-autofix/-/eslint-plugin-sort-imports-es6-autofix-0.6.0.tgz#b8cd8639d7a54cefce6b17898b102fd5ec31e52b"
integrity sha512-2NVaBGF9NN+727Fyq+jJYihdIeegjXeUUrZED9Q8FVB8MsV3YQEyXG96GVnXqWt0pmn7xfCZOZf3uKnIhBrfeQ== integrity sha512-2NVaBGF9NN+727Fyq+jJYihdIeegjXeUUrZED9Q8FVB8MsV3YQEyXG96GVnXqWt0pmn7xfCZOZf3uKnIhBrfeQ==
eslint-plugin-unicorn@42.0.0: eslint-plugin-unicorn@43.0.2:
version "42.0.0" version "43.0.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-42.0.0.tgz#47d60c00c263ad743403b052db689e39acbacff1" resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-43.0.2.tgz#b189d58494c8a0985a4b89dba5dbfde3ad7575a5"
integrity sha512-ixBsbhgWuxVaNlPTT8AyfJMlhyC5flCJFjyK3oKE8TRrwBnaHvUbuIkCM1lqg8ryYrFStL/T557zfKzX4GKSlg== integrity sha512-DtqZ5mf/GMlfWoz1abIjq5jZfaFuHzGBZYIeuJfEoKKGWRHr2JiJR+ea+BF7Wx2N1PPRoT/2fwgiK1NnmNE3Hg==
dependencies: dependencies:
"@babel/helper-validator-identifier" "^7.15.7" "@babel/helper-validator-identifier" "^7.18.6"
ci-info "^3.3.0" ci-info "^3.3.2"
clean-regexp "^1.0.0" clean-regexp "^1.0.0"
eslint-utils "^3.0.0" eslint-utils "^3.0.0"
esquery "^1.4.0" esquery "^1.4.0"
@ -10969,7 +10969,7 @@ eslint-plugin-unicorn@42.0.0:
read-pkg-up "^7.0.1" read-pkg-up "^7.0.1"
regexp-tree "^0.1.24" regexp-tree "^0.1.24"
safe-regex "^2.1.1" safe-regex "^2.1.1"
semver "^7.3.5" semver "^7.3.7"
strip-indent "^3.0.0" strip-indent "^3.0.0"
eslint-rule-composer@^0.3.0: eslint-rule-composer@^0.3.0: