oxc/crates/oxc_cli
Clark Fischer d88d76fdb8
Prioritize ignored paths when linting (#1878)
As discussed in #1124

A common workflow is running `oxlint` automatically via something like
lint-staged, which passes all changed file paths explicitly as CLI
arguments. The ignore crate auto-whitelists explicit paths, overriding
anything defined in an ignore file, leading to files that should be
ignored causing CI and VC hooks to fail.

eslint avoids this issue by giving precedence to .eslintignore unless
you pass `--no-ignore`.

Since `ignore` doesn't really give much control over this, the most
effective solution seems to be filtering. ~~Once we've got a list of
files to be linted, we can compare each against the .eslintignore and
see if it really truly should be linted.~~

~~Unfortunately, this is sort of a naive solution. Ignored directories
will still be walked, then filtered out after the fact. Changing this
behavior at the walker level would affect the formatter, which probably
isn't desirable.~~ (edit: The performance impact has been mostly
resolved.)

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
2024-01-04 03:44:10 +00:00
..
fixtures Prioritize ignored paths when linting (#1878) 2024-01-04 03:44:10 +00:00
src Prioritize ignored paths when linting (#1878) 2024-01-04 03:44:10 +00:00
Cargo.toml refactor(rust): move to workspace lint table (#1444) 2023-11-20 14:38:10 +08:00