-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add linter rule to require that relative imports use full extensions #220
Comments
I have such a rule already in place in a private repo. Also one for enforcing relative imports (instead of self-referencing your package name, which worked in v1 addons). And both are auto-fixable. I should be able to extract and open-source them hopefully soon... |
found it: {
files: ['src/**/*.{js,ts,gjs,gts}'],
rules: {
'import/extensions': ['error', 'always', { ignorePackages: true }],
},
}, https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md anyone want to PR a good eslint-plugin-import setup to the addon-blueprint here? |
Here is an issue to track progress import-js/eslint-plugin-import#2530 |
The addon build expects relative imports to use full extensions (.ts, .gts, .js, .hbs). This can be easy for an Ember developer to forget since it is not a requirement in ember-cli-built apps. It would be helpful to have a lint rule enabled by default that errors when a relative import is used without an extension.
The text was updated successfully, but these errors were encountered: