From 4045241ec76174617509abfd712bae8ba0d4ad0c Mon Sep 17 00:00:00 2001 From: Isaac Lee <16869656+ijlee2@users.noreply.github.com> Date: Wed, 14 Aug 2024 09:38:32 +0200 Subject: [PATCH] Updated blueprints (#88) * chore: Updated latestVersions * chore: Updated fixtures * feature: Downstreamed changes from @embroider/addon-blueprint@2.17.0 * chore: Updated fixtures --------- Co-authored-by: ijlee2 --- .../__addonLocation__/.eslintrc.cjs | 88 +++++++++++++------ src/utils/blueprints/get-version.ts | 26 +++--- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../ember-container-query/package.json | 22 ++--- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../output/ember-container-query/package.json | 22 ++--- .../ember-container-query/.eslintrc.cjs | 62 ++++++++----- .../output/ember-container-query/package.json | 16 ++-- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../output/ember-container-query/package.json | 22 ++--- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../output/ember-container-query/package.json | 22 ++--- .../packages/new-v1-addon/.eslintrc.cjs | 79 +++++++++++++---- .../output/packages/new-v1-addon/package.json | 22 ++--- .../output/new-v1-addon/.eslintrc.cjs | 62 ++++++++----- .../output/new-v1-addon/package.json | 16 ++-- .../output/new-v1-addon/.eslintrc.cjs | 62 ++++++++----- .../output/new-v1-addon/package.json | 16 ++-- .../output/new-v1-addon/.eslintrc.cjs | 62 ++++++++----- .../output/new-v1-addon/package.json | 16 ++-- .../output/new-v1-addon/.eslintrc.cjs | 79 +++++++++++++---- .../output/new-v1-addon/package.json | 22 ++--- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../ember-container-query/.eslintrc.cjs | 62 ++++++++----- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../ember-container-query/.eslintrc.cjs | 79 +++++++++++++---- .../output/ember-container-query/package.json | 22 ++--- .../ember-container-query/package.json | 22 ++--- .../output/ember-container-query/package.json | 22 ++--- .../output/ember-container-query/package.json | 16 ++-- .../output/ember-container-query/package.json | 22 ++--- .../output/ember-container-query/package.json | 22 ++--- .../output/ember-container-query/package.json | 22 ++--- tests/utils/blueprints/get-version.test.ts | 2 +- 37 files changed, 1185 insertions(+), 533 deletions(-) diff --git a/src/blueprints/ember-addon/__addonLocation__/.eslintrc.cjs b/src/blueprints/ember-addon/__addonLocation__/.eslintrc.cjs index f94081ff..afc6816a 100644 --- a/src/blueprints/ember-addon/__addonLocation__/.eslintrc.cjs +++ b/src/blueprints/ember-addon/__addonLocation__/.eslintrc.cjs @@ -2,51 +2,83 @@ module.exports = { root: true, - parser: '<%= options.packages.addon.hasTypeScript ? '@typescript-eslint/parser' : '@babel/eslint-parser' %>', - parserOptions: { - ecmaVersion: 'latest',<% if (!options.packages.addon.hasTypeScript) { %> - sourceType: 'module', - babelOptions: { - root: __dirname, - },<% } %> - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js'<%= options.packages.addon.hasTypeScript ? ", '**/*.ts'" : '' %>], + env: { browser: true }, + parser: '<%= options.packages.addon.hasTypeScript ? '@typescript-eslint/parser' : '@babel/eslint-parser' %>', + parserOptions: { + ecmaVersion: 'latest',<% if (!options.packages.addon.hasTypeScript) { %> + sourceType: 'module', + babelOptions: { + root: __dirname, + },<% } %> + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, <% if (options.packages.addon.hasTypeScript) { %> // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, -<% } else { %> // require relative imports use full extensions - { - files: ['src/**/*.{js,gjs}'], +<% } %> { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, -<% } %> // node files + // node files { files: [ './.eslintrc.cjs', @@ -62,7 +94,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/src/utils/blueprints/get-version.ts b/src/utils/blueprints/get-version.ts index 8f3e32af..7671678f 100644 --- a/src/utils/blueprints/get-version.ts +++ b/src/utils/blueprints/get-version.ts @@ -3,11 +3,11 @@ import { decideVersion } from '@codemod-utils/blueprints'; import type { Options } from '../../types/index.js'; const latestVersions = new Map([ - ['@babel/core', '7.24.7'], - ['@babel/eslint-parser', '7.24.7'], - ['@babel/plugin-transform-typescript', '7.24.7'], - ['@babel/runtime', '7.24.7'], - ['@embroider/addon-dev', '4.3.1'], + ['@babel/core', '7.25.2'], + ['@babel/eslint-parser', '7.25.1'], + ['@babel/plugin-transform-typescript', '7.25.2'], + ['@babel/runtime', '7.25.0'], + ['@embroider/addon-dev', '5.0.0'], ['@embroider/addon-shim', '1.8.9'], ['@embroider/test-setup', '4.0.0'], ['@glint/core', '1.4.0'], @@ -18,12 +18,12 @@ const latestVersions = new Map([ ['@types/ember__component', '4.0.22'], ['@types/ember__object', '4.0.12'], ['@types/ember__service', '4.0.9'], - ['@typescript-eslint/eslint-plugin', '7.12.0'], - ['@typescript-eslint/parser', '7.12.0'], + ['@typescript-eslint/eslint-plugin', '8.1.0'], + ['@typescript-eslint/parser', '8.1.0'], ['babel-plugin-ember-template-compilation', '2.2.5'], ['concurrently', '8.2.2'], ['decorator-transforms', '2.0.0'], - ['ember-auto-import', '2.7.3'], + ['ember-auto-import', '2.7.4'], ['ember-cli-babel', '8.1.0'], ['ember-cli-htmlbars', '6.3.0'], ['ember-template-lint', '6.0.0'], @@ -31,12 +31,12 @@ const latestVersions = new Map([ ['eslint-config-prettier', '9.1.0'], ['eslint-plugin-ember', '12.1.1'], ['eslint-plugin-import', '2.29.1'], - ['eslint-plugin-n', '17.8.1'], - ['eslint-plugin-prettier', '5.1.3'], - ['prettier', '3.3.1'], - ['rollup', '4.18.0'], + ['eslint-plugin-n', '17.10.2'], + ['eslint-plugin-prettier', '5.2.1'], + ['prettier', '3.3.3'], + ['rollup', '4.20.0'], ['rollup-plugin-copy', '3.5.0'], - ['typescript', '5.4.5'], + ['typescript', '5.5.4'], ]); export function getLatestVersion(packageName: string): string { diff --git a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.eslintrc.cjs b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json index b479a660..dfd480bb 100644 --- a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json @@ -59,10 +59,10 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@glint/core": "^1.4.0", "@glint/environment-ember-loose": "^1.4.0", "@glint/template": "^1.4.0", @@ -71,8 +71,8 @@ "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -80,12 +80,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/fixtures/ember-container-query-glint/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/ember-container-query-glint/output/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/ember-container-query-glint/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/ember-container-query-glint/output/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/ember-container-query-glint/output/ember-container-query/package.json b/tests/fixtures/ember-container-query-glint/output/ember-container-query/package.json index fd112c82..5a9db4c2 100644 --- a/tests/fixtures/ember-container-query-glint/output/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-glint/output/ember-container-query/package.json @@ -59,10 +59,10 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@glint/core": "^1.4.0", "@glint/environment-ember-loose": "^1.4.0", "@glint/template": "^1.4.0", @@ -71,8 +71,8 @@ "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -80,12 +80,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.eslintrc.cjs index 752e5766..136bbaba 100644 --- a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.eslintrc.cjs @@ -2,30 +2,46 @@ module.exports = { root: true, - parser: '@babel/eslint-parser', - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - babelOptions: { - root: __dirname, - }, - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ - // require relative imports use full extensions { - files: ['src/**/*.{js,gjs}'], + files: ['**/*.js'], + env: { browser: true }, + parser: '@babel/eslint-parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + babelOptions: { + root: __dirname, + }, + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -44,7 +60,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/package.json b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/package.json index 91b87db5..28fb4f94 100644 --- a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/package.json @@ -54,10 +54,10 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/eslint-parser": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/eslint-parser": "^7.25.1", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", @@ -66,10 +66,10 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0" }, "engines": { diff --git a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/package.json b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/package.json index 0b95fd69..11f87afc 100644 --- a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/package.json @@ -59,10 +59,10 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@glint/core": "^1.4.0", "@glint/environment-ember-loose": "^1.4.0", "@glint/template": "^1.4.0", @@ -71,8 +71,8 @@ "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -80,12 +80,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/package.json b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/package.json index 5f3b3cd6..428c10db 100644 --- a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/package.json @@ -59,17 +59,17 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "@tsconfig/ember": "^3.0.8", "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -77,12 +77,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.eslintrc.cjs b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.eslintrc.cjs +++ b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json index fbf6587b..b068db09 100644 --- a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json @@ -34,17 +34,17 @@ "decorator-transforms": "^2.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "@tsconfig/ember": "^3.0.8", "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -52,12 +52,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "peerDependencies": { "ember-source": "^3.28.0 || ^4.0.0" diff --git a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.eslintrc.cjs b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.eslintrc.cjs index 752e5766..136bbaba 100644 --- a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.eslintrc.cjs +++ b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.eslintrc.cjs @@ -2,30 +2,46 @@ module.exports = { root: true, - parser: '@babel/eslint-parser', - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - babelOptions: { - root: __dirname, - }, - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ - // require relative imports use full extensions { - files: ['src/**/*.{js,gjs}'], + files: ['**/*.js'], + env: { browser: true }, + parser: '@babel/eslint-parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + babelOptions: { + root: __dirname, + }, + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -44,7 +60,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/package.json index c92ef19f..4d43287e 100644 --- a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/package.json @@ -29,10 +29,10 @@ "decorator-transforms": "^2.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/eslint-parser": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/eslint-parser": "^7.25.1", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", @@ -41,10 +41,10 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0" }, "peerDependencies": { diff --git a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.eslintrc.cjs b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.eslintrc.cjs index 752e5766..136bbaba 100644 --- a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.eslintrc.cjs +++ b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.eslintrc.cjs @@ -2,30 +2,46 @@ module.exports = { root: true, - parser: '@babel/eslint-parser', - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - babelOptions: { - root: __dirname, - }, - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ - // require relative imports use full extensions { - files: ['src/**/*.{js,gjs}'], + files: ['**/*.js'], + env: { browser: true }, + parser: '@babel/eslint-parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + babelOptions: { + root: __dirname, + }, + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -44,7 +60,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/package.json index 75e9d737..bb447595 100644 --- a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/package.json @@ -29,10 +29,10 @@ "decorator-transforms": "^2.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/eslint-parser": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/eslint-parser": "^7.25.1", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", @@ -41,10 +41,10 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0" }, "peerDependencies": { diff --git a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.eslintrc.cjs b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.eslintrc.cjs index 752e5766..136bbaba 100644 --- a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.eslintrc.cjs +++ b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.eslintrc.cjs @@ -2,30 +2,46 @@ module.exports = { root: true, - parser: '@babel/eslint-parser', - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - babelOptions: { - root: __dirname, - }, - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ - // require relative imports use full extensions { - files: ['src/**/*.{js,gjs}'], + files: ['**/*.js'], + env: { browser: true }, + parser: '@babel/eslint-parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + babelOptions: { + root: __dirname, + }, + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -44,7 +60,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/package.json index 643e0de0..984047ed 100644 --- a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/package.json @@ -29,10 +29,10 @@ "decorator-transforms": "^2.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/eslint-parser": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/eslint-parser": "^7.25.1", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", @@ -41,10 +41,10 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0" }, "peerDependencies": { diff --git a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.eslintrc.cjs b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.eslintrc.cjs +++ b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/package.json index 6bbe06e4..1b7bfdb6 100644 --- a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/package.json @@ -34,17 +34,17 @@ "decorator-transforms": "^2.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "@tsconfig/ember": "^3.0.8", "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -52,12 +52,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "peerDependencies": { "ember-source": "^3.28.0 || ^4.0.0" diff --git a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.eslintrc.cjs b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.eslintrc.cjs index 752e5766..136bbaba 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.eslintrc.cjs @@ -2,30 +2,46 @@ module.exports = { root: true, - parser: '@babel/eslint-parser', - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - babelOptions: { - root: __dirname, - }, - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ - // require relative imports use full extensions { - files: ['src/**/*.{js,gjs}'], + files: ['**/*.js'], + env: { browser: true }, + parser: '@babel/eslint-parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + babelOptions: { + root: __dirname, + }, + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -44,7 +60,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.eslintrc.cjs b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.eslintrc.cjs index 441be9e4..06ae47cb 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.eslintrc.cjs +++ b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.eslintrc.cjs @@ -2,37 +2,76 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, + // Only use overrides + // https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs overrides: [ + { + files: ['**/*.js', '**/*.ts'], + env: { browser: true }, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + }, + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, // ts files { - files: ['**/*.ts', '**/*.gts'], + files: ['**/*.ts'], extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], // Add any custom rules here }, }, - // require relative imports use full extensions { - files: ['src/**/*.{js,ts,gjs,gts}'], + files: ['**/*.gts'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gts', + 'plugin:prettier/recommended', + ], rules: { + // require relative imports use full extensions 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here + }, + }, + { + files: ['**/*.gjs'], + parser: 'ember-eslint-parser', + plugins: ['ember', 'import'], + extends: [ + 'eslint:recommended', + 'plugin:ember/recommended', + 'plugin:ember/recommended-gjs', + 'plugin:prettier/recommended', + ], + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + // Add any custom rules here }, }, // node files @@ -51,7 +90,11 @@ module.exports = { node: true, }, plugins: ['n'], - extends: ['plugin:n/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], }, ], }; diff --git a/tests/fixtures/steps/update-addon-package-json/blueprints/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/blueprints/output/ember-container-query/package.json index d649ce5f..dd6fe167 100644 --- a/tests/fixtures/steps/update-addon-package-json/blueprints/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/blueprints/output/ember-container-query/package.json @@ -59,17 +59,17 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "@tsconfig/ember": "^3.0.8", "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -77,12 +77,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json index b479a660..dfd480bb 100644 --- a/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json @@ -59,10 +59,10 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@glint/core": "^1.4.0", "@glint/environment-ember-loose": "^1.4.0", "@glint/template": "^1.4.0", @@ -71,8 +71,8 @@ "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -80,12 +80,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/fixtures/steps/update-addon-package-json/glint/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/glint/output/ember-container-query/package.json index fd112c82..5a9db4c2 100644 --- a/tests/fixtures/steps/update-addon-package-json/glint/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/glint/output/ember-container-query/package.json @@ -59,10 +59,10 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@glint/core": "^1.4.0", "@glint/environment-ember-loose": "^1.4.0", "@glint/template": "^1.4.0", @@ -71,8 +71,8 @@ "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -80,12 +80,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/fixtures/steps/update-addon-package-json/javascript/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/javascript/output/ember-container-query/package.json index 91b87db5..28fb4f94 100644 --- a/tests/fixtures/steps/update-addon-package-json/javascript/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/javascript/output/ember-container-query/package.json @@ -54,10 +54,10 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/eslint-parser": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/eslint-parser": "^7.25.1", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", @@ -66,10 +66,10 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0" }, "engines": { diff --git a/tests/fixtures/steps/update-addon-package-json/public-assets/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/public-assets/output/ember-container-query/package.json index defe8257..ac02aef9 100644 --- a/tests/fixtures/steps/update-addon-package-json/public-assets/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/public-assets/output/ember-container-query/package.json @@ -59,17 +59,17 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "@tsconfig/ember": "^3.0.8", "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -77,12 +77,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/fixtures/steps/update-addon-package-json/scoped/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/scoped/output/ember-container-query/package.json index 0b95fd69..11f87afc 100644 --- a/tests/fixtures/steps/update-addon-package-json/scoped/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/scoped/output/ember-container-query/package.json @@ -59,10 +59,10 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@glint/core": "^1.4.0", "@glint/environment-ember-loose": "^1.4.0", "@glint/template": "^1.4.0", @@ -71,8 +71,8 @@ "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -80,12 +80,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/fixtures/steps/update-addon-package-json/typescript/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/typescript/output/ember-container-query/package.json index 5f3b3cd6..428c10db 100644 --- a/tests/fixtures/steps/update-addon-package-json/typescript/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/typescript/output/ember-container-query/package.json @@ -59,17 +59,17 @@ "ember-test-selectors": "^6.0.0" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7", - "@babel/runtime": "^7.24.7", - "@embroider/addon-dev": "^4.3.1", + "@babel/core": "^7.25.2", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.0", + "@embroider/addon-dev": "^5.0.0", "@rollup/plugin-babel": "^6.0.4", "@tsconfig/ember": "^3.0.8", "@types/ember__component": "^4.0.22", "@types/ember__object": "^4.0.12", "@types/ember__service": "^4.0.9", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "babel-plugin-ember-template-compilation": "^2.2.5", "concurrently": "^8.2.2", "ember-template-lint": "^6.0.0", @@ -77,12 +77,12 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-ember": "^12.1.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^17.8.1", - "eslint-plugin-prettier": "^5.1.3", - "prettier": "^3.3.1", - "rollup": "^4.18.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rollup": "^4.20.0", "rollup-plugin-copy": "^3.5.0", - "typescript": "^5.4.5" + "typescript": "^5.5.4" }, "engines": { "node": "14.* || 16.* || >= 18" diff --git a/tests/utils/blueprints/get-version.test.ts b/tests/utils/blueprints/get-version.test.ts index e8388295..308f3117 100644 --- a/tests/utils/blueprints/get-version.test.ts +++ b/tests/utils/blueprints/get-version.test.ts @@ -4,6 +4,6 @@ import { getLatestVersion, getVersion } from '../../../src/utils/blueprints.js'; import { options } from '../../helpers/shared-test-setups/typescript.js'; test('utils | blueprints | get-version', function () { - assert.strictEqual(getLatestVersion('prettier'), '^3.3.1'); + assert.strictEqual(getLatestVersion('prettier'), '^3.3.3'); assert.strictEqual(getVersion('prettier', options), '^2.8.1'); });