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

import/no-webpack-loader-syntax rule too strict #937

Closed
domtra opened this issue Jun 27, 2017 · 2 comments

Comments

@domtra
Copy link

commented Jun 27, 2017

Hi there, in #806 some useful new rule regarding imports were added for the standard v10.

Unfortunately, one rule was added that causes a lot of problems in many of our projects. That is rule import/no-webpack-loader-syntax. It prevents you from specifying loader options in an import or require statement.

While I agree that for general situation, the webpack config file should be the place to add loader configs, in some situation this is simply not possible, or rather a lot of unnecessary work. Also, using a loader config within import or require is an 'official' way, not deprecated or anything else.

The official docs for this rule state that it is a non-standard way to use import. However, importing a non js or json file without a bundler (webpack in this case) does not make any sense anyways.

At the moment using inline comments to disable the rule is the only way for us to continue using standard. This is not very feasible, either, but I really want to avoid having to ditch standard and moving to eslint instead.

What do you think? Do these points make sense to you? Is it possible to remove that rule again?

@domtra domtra referenced this issue Jun 27, 2017
@ematipico

This comment has been minimized.

Copy link
Contributor

commented Jun 28, 2017

You can add loader options inside your webpack config file. Can you not?

@stale

This comment has been minimized.

Copy link

commented May 10, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 10, 2018

@stale stale bot closed this May 17, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Aug 15, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.