-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Inconsistent behaviour with import/ignore
#478
Comments
ignore
import/ignore
There is an unfortunate (but practical) compromise in You should be able to remedy this by specifying the |
Thanks for the quick response, @benmosher.
"settings": {
"import/extensions": [
".js",
],
"import/ignore": [
"\.erb$",
"\.coffee$",
"node_modules"
],
"import/resolver": {
"webpack": {
"config": "./config/webpack.config.js"
}
}
}, Sadly the above change to my
This has given me a (fragile) workaround for now... I can use |
Yeah, it's not great. Sorry about that! I'm surprised you're the first one to hit this in a major way (and report it, anyway). I'm startled that |
Agh, okay. There is definitely a bug here. This can be patched in v1, I will try to knock this out some morning this week. |
@benmosher thanks for the quick and clear response, and, as always, thanks for the fantastic tool. Happy to work around this minor inconvenience. 👍 |
* always ignore invalid extensions if `import/extensions` is set (fixes #478) * reboot of npm `watch` script
This is also published with 1.13.0! (turned out I needed it too for typescript interop, has the same issue since it has |
Getting some strangely inconsistent behaviour with the
import/ignore
setting.My config:
The erroneous errors:
The file that that is throwing errors:
Lines 12 and 13 from
screenshots-editor.js
(the file containing failed imports above):The reason why I'm showing both of these lines is because both of these references files are
.js.erb
files.Line 8 from
screenshot-hitzone-editor.js.erb
:And the same erb syntax used in
rails-routes.js.erb
:// ... <%= routes = [ /^choose_test$/, /^confirm_destroy_response$/, // ...
So ESLint will try to parse
screenshot-hitzone-editor.js.erb
, but will (correctly) avoid parsingrails-routes.js.erb
. There are severalerb
files in the project, and this is the first time that this configuration strategy has failed.Note that I can replace the import statements with fully qualified paths, and the same problem occurs:
So the problem does appear to be with eslint-import AFAICT.
I'm happy to help debug this.
The text was updated successfully, but these errors were encountered: