oxc/apps/oxlint/fixtures/issue_7566/tests/function/main.js
dalaoshu 9761e94176
fix(apps/oxlint): incorrect matching in .oxlintignore (#7566)
The issue was discovered while updating test cases in `rolldown`.

In the `.oxlintignore` file, we have:
```ignore
tests/**
```

When running the command by `lint-staged`:

```bash
oxlint -c .oxlintrc.json --ignore-path=.oxlintignore --deny-warnings "tests/function/main.js"
```

The file `main.js` gets linted despite being ignored. This happens
because, before using `Gitignore::new`, we converted paths to absolute
paths, causing the pattern `tests/**` to not match
`D:/rolldown/tests/function/main.js` correctly.


c61a383e8c/apps/oxlint/src/lint.rs (L60-L78)
2024-12-02 11:06:20 +08:00

1 line
12 B
JavaScript