oxc icon indicating copy to clipboard operation
oxc copied to clipboard

oxc_language_server incorrectly resolves .gitignore patterns

Open valeneiko opened this issue 1 year ago • 0 comments

If a repo has multiple .gitignore files, oxc_language_server will apply all patterns as if both file were in the root of the repo.

Imagine the following project structure:

/repo
  /projectA
    .gitignore
  /projectB
    index.ts
  .gitignore
# /repo/projectA/.gitignore
*
!.gitignore
# /repo/.gitignore
node_modules

When I save /repo/projectB/index.ts OXC VSCode extension does nothing, and I can see the following in the logs:

[2024-05-03T15:56:57Z DEBUG oxc_language_server] oxc server did save
[2024-05-03T15:56:57Z DEBUG oxc_language_server] ignored: file:///repo/projectB/index.ts

If I delete /repo/projectA/.gitignore, then VSCode extension correctly runs lint on that file.

valeneiko avatar May 03 '24 16:05 valeneiko