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-duplicates: add a query-string option to handle false positives wh… #1108

Merged
merged 1 commit into from Dec 6, 2019

Conversation

pcorpet
Copy link
Contributor

@pcorpet pcorpet commented May 28, 2018

…en using some webpack loaders. Fixes #1107.

…se positives when using some webpack loaders.

Fixes import-js#1107.
@coveralls
Copy link

coveralls commented May 28, 2018

Coverage Status

Coverage decreased (-0.06%) to 96.4% when pulling f12ae59 on pcorpet:master into 2d3d045 on benmosher:master.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add to the rule schema.

Why a string of “different”? What other options are allowed?

@@ -35,6 +35,31 @@ The motivation is that this is likely a result of two developers importing diffe
names from the same module at different times (and potentially largely different
locations in the file.) This rule brings both (or n-many) to attention.

### Query Strings

By default, this rule ignores query strings (i.e. paths followed by a question mark), and thus imports from `./mod?a` and `./mod?b` will be considered as duplicates. However you can use the option `query-string` to handle them as different (usually because a webpack loader would actually resolve those imports differently).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

primarily because browsers will resolve them differently; a webpack loader is secondary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@pcorpet
Copy link
Contributor Author

pcorpet commented Jun 13, 2018

Schema added to the rule.

I had the impression that several options could be offered, but let's keep it simple for now as I don't have any immediate usecase.

@pcorpet
Copy link
Contributor Author

pcorpet commented Jul 7, 2018

@benmosher @jfmengels can I get a review please?

@pcorpet pcorpet force-pushed the master branch 3 times, most recently from 0328e99 to 7aa4ce2 Compare July 19, 2018 14:32
@EECOLOR
Copy link

EECOLOR commented Dec 5, 2019

@ljharb what do we need to do to get this pull request merged?

@ljharb ljharb merged commit f12ae59 into import-js:master Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

no-duplicates rule with query-string params
4 participants