Skip to content

Commit 06e2b92

Browse files
authored
docs(linter): Add instructions for testing oxlint changes against a large codebase. (#633)
1 parent b3dccd1 commit 06e2b92

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/docs/contribute/linter.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ Or test and filter against the rule:
2323
just watch "cargo test -p oxc_linter -- rule-name"
2424
```
2525

26+
### Testing oxlint against a full codebase
27+
28+
To test oxlint on a full codebase, for example to test your changes with a large JavaScript/TypeScript project, you can build the `oxlint` CLI and run it against that codebase.
29+
30+
```bash
31+
# build the oxlint cli in the oxc repo
32+
just oxlint-node
33+
# and then in the directory of the codebase you want to test with, run oxlint with node:
34+
node <path-to-oxc-repo>/apps/oxlint/dist/cli.js
35+
# You can also pass flags to it, like -D to enable a specific rule, and --disable-x-plugin to turn off default plugins:
36+
node <path-to-oxc-repo>/apps/oxlint/dist/cli.js -D rulename --disable-unicorn-plugin --disable-oxc-plugin --disable-typescript-plugin
37+
```
38+
2639
### Snapshot Testing
2740

2841
[`cargo insta`](https://insta.rs/docs) is used for snapshot testing.

0 commit comments

Comments
 (0)