Skip to content

Commit

Permalink
update linter usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Nov 9, 2023
1 parent e2d85aa commit 86f2036
Showing 1 changed file with 21 additions and 40 deletions.
61 changes: 21 additions & 40 deletions docs/usage/linter.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ npx oxlint@latest

You may also use `yarn dlx`, `pnpm dlx`, `bunx` or `deno run` because `oxlint` is published to npm.

## VSCode Extension

https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode

## Continuous Integration

We recommend running `oxlint` before `eslint` in your CI for faster feedback loops,
since `oxlint` only takes a few seconds to run.

### GitHub Actions

```yaml
jobs:
oxlint:
name: Lint JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npx --yes oxlint@latest
```
### Commands
Run `npx oxlint@latest --rules` for the list of rules.
Expand All @@ -52,53 +73,13 @@ Enable Plugins
--jest-plugin Enable the Jest plugin and detect test problems
--jsx-a11y-plugin Enable the JSX-a11y plugin and detect accessibility problems

Fix Problems
--fix Fix as many issues as possible. Only unfixed issues are reported in the
output
Ignore Files
--ignore-path=PATH Specify the file to use as your .eslintignore
--ignore-pattern=PAT Specify patterns of files to ignore (in addition to those in .eslintignore)
--no-ignore Disables excluding of files from .eslintignore files, --ignore-path flags
and --ignore-pattern flags
Handle Warnings
--quiet Disable reporting on warnings, only errors are reported
--max-warnings=INT Specify a warning threshold, which can be used to force exit with an error
status if there are too many warning-level rule violations in your project
Miscellaneous
--timing Display the execution time of each lint rule
[env:TIMING: not set]
--rules list all the rules that are currently registered
--threads=INT Number of threads to use. Set to 1 for using only 1 CPU core
Codeowners
--codeowners-file=PATH Path to CODEOWNERS file
--codeowners=NAME Code owner names, e.g. @Boshen
Available positional items:
PATH Single file, single path or list of paths

Available options:
-h, --help Prints help information
```

## VSCode Extension

https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode

## GitHub Actions

```yaml
oxlint:
name: Lint JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npx --yes oxlint@latest
```
## Without Node.js

You may download the binaries from the [latest GitHub releases](https://github.com/web-infra-dev/oxc/releases/latest).
Expand Down

0 comments on commit 86f2036

Please sign in to comment.