Skip to content
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

[ENHANCEMENT] Upgrade ESLint to v8 in app and addon blueprints #9669

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions blueprints/app/files/.eslintrc.js
Expand Up @@ -2,12 +2,15 @@

module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
Comment on lines +11 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question

Now that @babel/plugin-proposal-decorators is used, I don't think we need the ecmaFeatures key (along with legacyDecorators) anymore (lines 9-11)?

The first commit (e97c6ad) shows that ecmaFeatures had been removed. I wonder if it got accidentally re-introduced by merging master (i.e. a rebase didn't happen correctly).

],
},
},
plugins: ['ember'],
Expand Down
5 changes: 3 additions & 2 deletions blueprints/app/files/package.json
Expand Up @@ -23,14 +23,15 @@
"test:ember": "ember test"
bertdeblock marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way we can bundle these dependencies as fallbacks? so we don't have to bundle them in the app's package.json?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is! I found a way

Copy link
Contributor

@ijlee2 ijlee2 Dec 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug (blocking)

Before, babel-eslint was added to package.json via the else clause. You'll want to add @babel/eslint-parser and @babel/plugin-proposal-decorators conditionally.

Pseudocode:

<% if (!typescript) { %>
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-decorators": "^7.20.5",
<% } %>

I listed the latest versions above, in case you want the latest.

"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2<% if (embroider) { %>",
"@embroider/compat": "^0.44.1",
"@embroider/core": "^0.44.1",
"@embroider/webpack": "^0.44.1<% } %>",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.2.0",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -51,7 +52,7 @@
"ember-source": "~4.0.0-beta.4",
"ember-template-lint": "^3.7.0<% if (welcome) { %>",
"ember-welcome-page": "^5.0.0<% } %>",
"eslint": "^7.32.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
Expand Down
9 changes: 6 additions & 3 deletions tests/fixtures/addon/.eslintrc.js
Expand Up @@ -2,12 +2,15 @@

module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }]
],
},
},
plugins: ['ember'],
Expand Down
11 changes: 6 additions & 5 deletions tests/fixtures/addon/defaults-travis/package.json
Expand Up @@ -30,12 +30,13 @@
"ember-cli-htmlbars": "^5.7.1"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.2.5",
"@embroider/test-setup": "^0.41.0",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.11.3",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -54,12 +55,12 @@
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^3.4.2",
"ember-try": "^1.4.0",
"eslint": "^7.27.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.4.2",
"eslint-plugin-ember": "^10.5.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems outdated, don't think this version should be touched for this PR?

"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-qunit": "^6.1.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-qunit": "^6.2.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.3.0",
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/addon/defaults/package.json
Expand Up @@ -30,12 +30,13 @@
"ember-cli-htmlbars": "^5.7.1"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2",
"@embroider/test-setup": "^0.44.1",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.2.0",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -53,7 +54,7 @@
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^3.7.0",
"ember-try": "^1.4.0",
"eslint": "^7.32.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/addon/yarn/package.json
Expand Up @@ -30,12 +30,13 @@
"ember-cli-htmlbars": "^5.7.1"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2",
"@embroider/test-setup": "^0.44.1",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.2.0",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -54,7 +55,7 @@
"ember-template-lint": "^3.7.0",
"ember-try": "^1.4.0",
"ember-welcome-page": "^5.0.0",
"eslint": "^7.32.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
Expand Down
9 changes: 6 additions & 3 deletions tests/fixtures/app/.eslintrc.js
Expand Up @@ -2,12 +2,15 @@

module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/app/defaults/package.json
Expand Up @@ -23,11 +23,12 @@
"test:ember": "ember test"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.2.0",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -48,7 +49,7 @@
"ember-source": "~4.0.0-beta.4",
"ember-template-lint": "^3.7.0",
"ember-welcome-page": "^5.0.0",
"eslint": "^7.32.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/app/embroider-no-welcome/package.json
Expand Up @@ -23,14 +23,15 @@
"test:ember": "ember test"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2",
"@embroider/compat": "^0.44.1",
"@embroider/core": "^0.44.1",
"@embroider/webpack": "^0.44.1",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.2.0",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -50,7 +51,7 @@
"ember-resolver": "^8.0.3",
"ember-source": "~4.0.0-beta.4",
"ember-template-lint": "^3.7.0",
"eslint": "^7.32.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/app/embroider-yarn/package.json
Expand Up @@ -23,14 +23,15 @@
"test:ember": "ember test"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2",
"@embroider/compat": "^0.44.1",
"@embroider/core": "^0.44.1",
"@embroider/webpack": "^0.44.1",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.2.0",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -51,7 +52,7 @@
"ember-source": "~4.0.0-beta.4",
"ember-template-lint": "^3.7.0",
"ember-welcome-page": "^5.0.0",
"eslint": "^7.32.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/app/embroider/package.json
Expand Up @@ -23,14 +23,15 @@
"test:ember": "ember test"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2",
"@embroider/compat": "^0.44.1",
"@embroider/core": "^0.44.1",
"@embroider/webpack": "^0.44.1",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.2.0",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -51,7 +52,7 @@
"ember-source": "~4.0.0-beta.4",
"ember-template-lint": "^3.7.0",
"ember-welcome-page": "^5.0.0",
"eslint": "^7.32.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
Expand Down
11 changes: 6 additions & 5 deletions tests/fixtures/app/nested-project/actual-project/package.json
Expand Up @@ -23,11 +23,12 @@
"test:ember": "ember test"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.2.5",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.11.2",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -48,12 +49,12 @@
"ember-source": "~3.27.0-beta.3",
"ember-template-lint": "^3.2.0",
"ember-welcome-page": "^5.0.0",
"eslint": "^7.24.0",
"eslint-config-prettier": "^8.1.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-qunit": "^6.0.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-qunit": "^6.2.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
Expand Down
11 changes: 6 additions & 5 deletions tests/fixtures/app/npm-travis/package.json
Expand Up @@ -23,11 +23,12 @@
"test:ember": "ember test"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.2.5",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.11.3",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -48,12 +49,12 @@
"ember-resolver": "^8.0.2",
"ember-source": "~3.27.2",
"ember-template-lint": "^3.4.2",
"eslint": "^7.27.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.4.2",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-qunit": "^6.1.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-qunit": "^6.2.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.3.0",
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/app/npm/package.json
Expand Up @@ -23,11 +23,12 @@
"test:ember": "ember test"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^2.2.0",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -47,7 +48,7 @@
"ember-resolver": "^8.0.3",
"ember-source": "~4.0.0-beta.4",
"ember-template-lint": "^3.7.0",
"eslint": "^7.32.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
Expand Down
Expand Up @@ -2,12 +2,15 @@

module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
Expand Down
Expand Up @@ -23,11 +23,12 @@
"test:ember": "ember test"
},
"devDependencies": {
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.2.0",
"@glimmer/component": "^1.0.3",
"@glimmer/tracking": "^1.0.3",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.10.1",
"ember-cli": "~<%= emberCLIVersion %>",
Expand All @@ -48,11 +49,12 @@
"ember-source": "~3.26.0-beta.2",
"ember-template-lint": "^2.18.1",
"ember-welcome-page": "^5.0.0",
"eslint": "^7.20.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-ember": "^10.2.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-qunit": "^6.2.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
Expand Down