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

Extensions: exception/option for global imports #934

Closed
QuentinRoy opened this issue Sep 26, 2017 · 2 comments
Closed

Extensions: exception/option for global imports #934

QuentinRoy opened this issue Sep 26, 2017 · 2 comments

Comments

@QuentinRoy
Copy link

Enhancement proposal: global case for extensions.

I think it is starting to be good practice to alway specify the extension of a file, i.e. "import/extensions": ["error", "always"] as this will be required with browsers' module loaders.

However, this causes issues when using with webpack or others and importing libraries installed in the node_modules (e.g. import 'react') that cannot have the '.js' extension.

It would be useful to be able to create a case for global imports, e.g. [<enabled>, "alway", { "globals": "never" }].

@ljharb
Copy link
Member

ljharb commented Sep 26, 2017

When you say "global", do you mean bare specifiers, i.e. things in node_modules? If so this might be a duplicate of #414.

@QuentinRoy
Copy link
Author

Oops. Indeed I missed this issue. Thanks.

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

No branches or pull requests

2 participants