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

Why is eslint-plugin-import configured to ignore node_modules? #2457

Open
MustafaHaddara opened this issue Aug 20, 2021 · 4 comments · May be fixed by #2464
Open

Why is eslint-plugin-import configured to ignore node_modules? #2457

MustafaHaddara opened this issue Aug 20, 2021 · 4 comments · May be fixed by #2464

Comments

@MustafaHaddara
Copy link
Contributor

In eslint-config-airbnb-base/rules/imports.js, import/ignore is set to ignore node_modules and a number of non-js files (coffee, css, etc.)

Ignoring node_modules means that none of the lint analysis can happen against external libraries. In particular, I care about import/named flagging things like

import { badBadBad } from 'redux';

What's the rationale for this change? We can already use eslint's native ignore functionality to avoid linting all of node_modules, right?

@ljharb
Copy link
Collaborator

ljharb commented Aug 20, 2021

I added that in b45fdcd, because it's what airbnb was using internally at the time.

https://github.com/import-js/eslint-plugin-import#importignore suggests that in fact we should remove node_modules from this setting - I'd want to treat that as semver-major, however, since it could result in a lot more warnings.

@MustafaHaddara
Copy link
Contributor Author

I'm happy to write that PR.

How do you manage releases on this library? Is there a schedule/readmap for upcoming semver-major releases? Is this change big enough to merit its own major release?

@ljharb
Copy link
Collaborator

ljharb commented Aug 30, 2021

There’s no schedule, and major releases are avoided for as long as possible. It’s definitely not big enough to warrant one solely for that, since it’s a change you can make in your own config.

We can queue up the PR, though, and then whenever a major release does happen, it will be pulled in.

@MustafaHaddara
Copy link
Contributor Author

Fair enough, that makes sense.

I'll put up a PR and link it to this issue.

Thanks!

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

Successfully merging a pull request may close this issue.

2 participants