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

linter: --import-plugin checking inside node_modules #7123

Closed
anthonyshew opened this issue Nov 4, 2024 · 5 comments · Fixed by #7373
Closed

linter: --import-plugin checking inside node_modules #7123

anthonyshew opened this issue Nov 4, 2024 · 5 comments · Fixed by #7373
Labels
A-linter Area - Linter C-bug Category - Bug

Comments

@anthonyshew
Copy link

anthonyshew commented Nov 4, 2024

What version of Oxlint are you using?

0.11.0

What command did you run?

oxlint -A all -D no-cycle --import-plugin

What does your .oxlint.json config file look like?

Don't have one!

What happened?

We have a dependency that has // @flow in node_modules that throws out an error. I tried to patch-package it, but then it threw on a different error for import { type foo } ....

When I remove --import-plugin, the error stops showing up. The exact dependency in question is react-select@4.3.1.

@anthonyshew anthonyshew added A-linter Area - Linter C-bug Category - Bug labels Nov 4, 2024
@anthonyshew anthonyshew changed the title linter: --import-plugin checking inside node_modules linter: --import-plugin checking inside node_modules Nov 4, 2024
@DonIsaac
Copy link
Contributor

DonIsaac commented Nov 4, 2024

Is this file actually using flow syntax? And is it being imported (either directly or as an import of an import)?

If so, this is intentional behavior.

@Boshen
Copy link
Member

Boshen commented Nov 5, 2024

The exact dependency in question is react-select@4.3.1

Which file exactly? I'm not seeing any published files with a // @flow comment.

@anthonyshew
Copy link
Author

anthonyshew commented Nov 7, 2024

The files with the // @flow comment are here: https://github.com/JedWatson/react-select/tree/d5c5ccd864ebba7c9d8a41146be666dff9b79b38/packages/react-select/src/components

Realizing now, I forgot to add that I tried to ignore errors from node_modules using --ignore-path=node_modules and that didn't help. I didn't really expect it to, but was worth a try. 😄

@DonIsaac, can you say why this would be the intended behavior? It's being imported into our code, but I was hoping I could lint our code, not node_modules. I'm sure there's a good reason why and I'm just not getting it.

@pumano
Copy link
Contributor

pumano commented Nov 7, 2024

@anthonyshew try to add .eslintignore file in root folder of project and add node_modules/* to that. That should helps you. We also working on "excludes" in config, but that work in progress.

@anthonyshew
Copy link
Author

@pumano A .eslintignore file doesn't look like it's working for me either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-bug Category - Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants