Skip to content

import/extensions: does not complain about .vue file #1533

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
sethidden opened this issue Nov 2, 2019 · 2 comments
Closed

import/extensions: does not complain about .vue file #1533

sethidden opened this issue Nov 2, 2019 · 2 comments

Comments

@sethidden
Copy link

sethidden commented Nov 2, 2019

Hey, I was trying to set up import/extensions rule. I wanted to make it so that only .vue files require an extension in the import.

This is similar to #583 , just for .vue

Test case:

{
  'import/extensions': ['error', 'never', { vue: 'always', js: 'always'}]
}
import HelloWorld from '../components/HelloWorld' //vue file, no error
import a from '../components/stuff' //js file, errors correctly

My package.json and .eslintrc.js when testing

@sethidden
Copy link
Author

Same behavior for

"import/extensions": ["error", "ignorePackages", { "vue": "always", js: "always" }],

and for the two imports from the above questions.

@ljharb
Copy link
Member

ljharb commented Dec 5, 2019

See the test case that closes that similar issue: https://github.com/benmosher/eslint-plugin-import/pull/1010/files

you need to also configure the import/resolve extension for .vue.

@ljharb ljharb closed this as completed Dec 5, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

2 participants