Skip to content

Commit

Permalink
Merge pull request #284 from embroider-build/update-eslint-prettier-etc
Browse files Browse the repository at this point in the history
Update the linting packages and the eslint config
  • Loading branch information
NullVoxPopuli authored Apr 30, 2024
2 parents a27ffcc + 74c7ae3 commit eef3557
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 35 deletions.
88 changes: 62 additions & 26 deletions files/__addonLocation__/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,83 @@

module.exports = {
root: true,
parser: '<%= typescript ? '@typescript-eslint/parser' : '@babel/eslint-parser' %>',
parserOptions: {
ecmaVersion: 'latest',<% if (!typescript) { %>
sourceType: 'module',
babelOptions: {
root: __dirname,
},<% } %>
},
plugins: ['ember', 'import'],
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'<%= typescript ? ", '**/*.ts'" : '' %>],
env: { browser: true },
parser: '<%= typescript ? '@typescript-eslint/parser' : '@babel/eslint-parser' %>',
parserOptions: {
ecmaVersion: 'latest',<% if (!typescript) { %>
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 (typescript) { %> // 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',
Expand All @@ -62,7 +94,11 @@ module.exports = {
node: true,
},
plugins: ['n'],
extends: ['plugin:n/recommended'],
extends: [
'eslint:recommended',
'plugin:n/recommended',
'plugin:prettier/recommended',
],
},
],
};
19 changes: 10 additions & 9 deletions files/__addonLocation__/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,21 @@
"@types/ember__modifier": "^4.0.8",
"@types/ember__helper": "^4.0.5",
"@types/ember__routing": "^4.0.19",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",<% } %>
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",<% } %>
"@rollup/plugin-babel": "^6.0.4",
"babel-plugin-ember-template-compilation": "^2.2.2",
"concurrently": "^8.2.2",
"ember-template-lint": "^5.13.0",
"eslint": "^8.56.0",
"ember-template-lint": "^6.0.0",<% if (packageManager === 'npm') { %>
"ember-eslint-parser": "^0.4.2",
<% } %>"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^11.12.0",
"eslint-plugin-ember": "^12.0.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-prettier": "^5.0.1",
"prettier": "^3.1.1",
"prettier-plugin-ember-template-tag": "^1.1.0",
"eslint-plugin-n": "^17.3.1",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
"prettier-plugin-ember-template-tag": "^2.0.2",
"rollup": "^4.16.4"<% if (!isExistingMonorepo) { %>,
"rollup-plugin-copy": "^3.5.0"<% } %><% if (typescript) { %>,
"typescript": "^5.4.5"<% } %>
Expand Down

0 comments on commit eef3557

Please sign in to comment.