diff --git a/files/__addonLocation__/.eslintrc.cjs b/files/__addonLocation__/.eslintrc.cjs index 5384483..639c4b9 100644 --- a/files/__addonLocation__/.eslintrc.cjs +++ b/files/__addonLocation__/.eslintrc.cjs @@ -10,7 +10,7 @@ module.exports = { root: __dirname, },<% } %> }, - plugins: ['ember'], + plugins: ['ember', 'import'], extends: [ 'eslint:recommended', 'plugin:ember/recommended', @@ -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: [ diff --git a/files/__addonLocation__/package.json b/files/__addonLocation__/package.json index a81736c..84f9c8e 100644 --- a/files/__addonLocation__/package.json +++ b/files/__addonLocation__/package.json @@ -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",