Skip to content
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

No errors when "import/extensions": ["error", "ignorePackages"] #1518

Closed
saschanaz opened this issue Oct 27, 2019 · 5 comments · Fixed by #1521
Closed

No errors when "import/extensions": ["error", "ignorePackages"] #1518

saschanaz opened this issue Oct 27, 2019 · 5 comments · Fixed by #1521

Comments

@saschanaz
Copy link
Contributor

saschanaz commented Oct 27, 2019

It doesn't show any errors , I had to do the following instead to get the expected behavior:

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

It seems src/rules/extensions.js allows but doesn't really expect defaultConfig to be "ignorePackages".

@ljharb
Copy link
Member

ljharb commented Oct 27, 2019

I’m not sure what the issue is here - the defaults can’t be changed without a semver-major bump.

@saschanaz
Copy link
Contributor Author

saschanaz commented Oct 27, 2019

Shouldn't ["error", "ignorePackages"] error for extensionless non-package module imports? Currently it never errors even when in mixed situation where some have extensions and others not.

@ljharb
Copy link
Member

ljharb commented Oct 27, 2019

Yes, it should. Can you provide code where it’s not?

@saschanaz
Copy link
Contributor Author

saschanaz commented Oct 27, 2019

AFK but I don't see any relevant 'invalid' test in https://github.com/benmosher/eslint-plugin-import/blob/master/tests/src/rules/extensions.js

@ljharb
Copy link
Member

ljharb commented Oct 27, 2019

True, but I’d expect it to behave the same as https://github.com/benmosher/eslint-plugin-import/blob/112a0bf442e52b25cd7029a9905df2508e191ac1/tests/src/rules/extensions.js#L298. Some example code where it doesn’t would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants