Skip to content

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

Merged
ljharb merged 1 commit into
import-js:masterfrom
aberezkin:ignore-from-pattern-for-no-namespace
Aug 7, 2021
Merged

[New] no-namespace: Add ignore option#2112
ljharb merged 1 commit into
import-js:masterfrom
aberezkin:ignore-from-pattern-for-no-namespace

Conversation

@aberezkin

@aberezkin aberezkin commented Jun 2, 2021

Copy link
Copy Markdown

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

coveralls commented Jun 2, 2021

Copy link
Copy Markdown

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

aberezkin commented Jun 10, 2021

Copy link
Copy Markdown
Author

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

@gairon

gairon commented Jul 27, 2021

Copy link
Copy Markdown

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

@aberezkin

aberezkin commented Jul 27, 2021

Copy link
Copy Markdown
Author

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

@gairon

gairon commented Aug 6, 2021

Copy link
Copy Markdown

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

Comment thread src/rules/no-namespace.js Outdated
@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
Comment thread docs/rules/no-namespace.md Outdated
Comment thread docs/rules/no-namespace.md Outdated
Comment thread src/rules/no-namespace.js
@aberezkin

Copy link
Copy Markdown
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

gairon commented Sep 21, 2021

Copy link
Copy Markdown

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

ljharb commented Sep 21, 2021

Copy link
Copy Markdown
Member

@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