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: "ignorePatterns" not causing files to be ignored when . is passed in to CLI #9023

Open
nolanlawson opened this issue Feb 10, 2025 · 3 comments · May be fixed by #9382
Open

Linter: "ignorePatterns" not causing files to be ignored when . is passed in to CLI #9023

nolanlawson opened this issue Feb 10, 2025 · 3 comments · May be fixed by #9382
Labels
A-linter Area - Linter C-bug Category - Bug

Comments

@nolanlawson
Copy link

nolanlawson commented Feb 10, 2025

Thanks for making Oxc! It's fast and very helpful. 🙂

I've noticed that, in certain cases, "ignorePatterns" in .oxlintrc.json does not ignore certain files when running oxlint --fix. This only seems to occur with deep directories, and only when adding . to the end of the CLI command.

Here is a minimal repro of the issue:

git clone git@github.com:nolanlawson/repro-oxlint-ignore-issue.git repro
cd repro
npm i
npm run lint

Here is what's happening. "ignorePatterns":

  "ignorePatterns": [
    "foo.js",
    "a/bar.js"
  ],

This works, and ignores both files:

oxlint -c .oxlintrc.json --fix

However, adding . to the end of the command causes bar.js to no longer be ignored:

oxlint -c .oxlintrc.json --fix .

If you run this second command, you'll see that foo.js is correctly ignored, but a/bar.js is not:

--- a/a/bar.js
+++ b/a/bar.js
@@ -1,2 +1,2 @@
-debugger
+
 console.log("Don't lint me!!")
@nolanlawson nolanlawson added the C-bug Category - Bug label Feb 10, 2025
@shulaoda
Copy link
Member

shulaoda commented Feb 12, 2025

I am unable to reproduce your issue:

PS D:\shulaoda\repro-oxlint-ignore-issue> pnpm oxlint -c .oxlintrc.json --fix
Found 0 warnings and 0 errors.
Finished in 2ms on 0 files with 61 rules using 20 threads.
PS D:\shulaoda\repro-oxlint-ignore-issue> pnpm oxlint -c .oxlintrc.json --fix .
Found 0 warnings and 0 errors.
Finished in 2ms on 0 files with 61 rules using 20 threads.

Could you tell me the operating system you are using?

@nolanlawson
Copy link
Author

I'm using macOS.

@Sysix Sysix added the A-linter Area - Linter label Feb 15, 2025
@BenShelton
Copy link
Contributor

Can recreate on mac, happy to take this on 😄

BenShelton added a commit to BenShelton/oxc that referenced this issue Feb 26, 2025
@BenShelton BenShelton linked a pull request Feb 26, 2025 that will close this issue
BenShelton added a commit to BenShelton/oxc that referenced this issue Feb 28, 2025
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