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

[New] no-namespace: Add ignore option #2112

Merged

Conversation

aberezkin
Copy link

@aberezkin aberezkin commented Jun 2, 2021

Closes #1916
Closes #1903

Hi, we want to use the rule no-namespace in our project but we have a i18n codegen tool that forces us to use wildcard imports for certain files that follow some pattern (\S+\.i18n, to be precise). Also I've seen that there's people with similar issue.

I thought that we can implement something similar to argsIgnorePattern/varsIgnorePattern in core eslint rules.

I made a test for that case and updated the docs as well. Please let me know if there's something else I should do to get this merged.

@coveralls
Copy link

coveralls commented Jun 2, 2021

Coverage Status

Coverage increased (+0.9%) to 82.635% when pulling 0c4e324 on aberezkin:ignore-from-pattern-for-no-namespace into 7aea664 on benmosher:master.

@aberezkin
Copy link
Author

aberezkin commented Jun 10, 2021

Hi @ljharb! Can you look at this PR? It's quite similar to #1916. But adds a little more versatile option.

@gairon
Copy link

gairon commented Jul 27, 2021

Hi @aberezkin, any updates on that ? Have the same problem with this rule.

@aberezkin
Copy link
Author

aberezkin commented Jul 27, 2021

Hi @gairon. I would be happy to provide some update but I can't merge it myself since I'm not a maintainer 😄

@gairon
Copy link

gairon commented Aug 6, 2021

Who else can help with verifying and pushing a really cool feature?
@ljharb @benmosher ?

src/rules/no-namespace.js Outdated Show resolved Hide resolved
@aberezkin aberezkin force-pushed the ignore-from-pattern-for-no-namespace branch from 7e191f5 to 94ab4d5 Compare August 6, 2021 18:06
@aberezkin aberezkin requested a review from ljharb August 6, 2021 18:09
docs/rules/no-namespace.md Outdated Show resolved Hide resolved
docs/rules/no-namespace.md Outdated Show resolved Hide resolved
src/rules/no-namespace.js Show resolved Hide resolved
@aberezkin
Copy link
Author

@ljharb Fixed! :)

@aberezkin aberezkin requested a review from ljharb August 6, 2021 20:18
@ljharb ljharb changed the title Add ignoreFromPattern option for no-namespace rule [New] no-namespace: Add ignore option Aug 6, 2021
@ljharb ljharb force-pushed the ignore-from-pattern-for-no-namespace branch from 982c0ee to bba59c4 Compare August 7, 2021 16:54
@ljharb ljharb merged commit bba59c4 into import-js:master Aug 7, 2021
@gairon
Copy link

gairon commented Sep 21, 2021

Hi @aberezkin,
thanks for the new option.
Found a typo in docs:
/* eslint import/no-namespace: ["error", {ignore: ['*.ext']] */
there missed } before last ].

ljharb added a commit that referenced this pull request Sep 21, 2021
@ljharb
Copy link
Member

ljharb commented Sep 21, 2021

@gairon thanks, fixed in 4f0f560

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-namespace] allow namespace imports for specific modules
4 participants