Skip to content

Commit

Permalink
Add ESLint rule to require that relative imports use full extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeAstapov committed Mar 29, 2024
1 parent 8b7e2be commit 56aab7b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions files/__addonLocation__/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ module.exports = {
// Add any custom rules here
},
},
// require relative imports use full extensions
{
files: ['src/**/*.{js,ts,gjs,gts}'],
rules: {
'import/extensions': ['error', 'always', { ignorePackages: true }],
},
},
<% } else { %> // require relative imports use full extensions
{
files: ['src/**/*.{js,gjs}'],
rules: {
'import/extensions': ['error', 'always', { ignorePackages: true }],
},
},
<% } %> // node files
{
files: [
Expand Down
1 change: 1 addition & 0 deletions files/__addonLocation__/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^11.12.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-prettier": "^5.0.1",
"prettier": "^3.1.1",
Expand Down

0 comments on commit 56aab7b

Please sign in to comment.