Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions src/docs/guide/usage/formatter/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,48 @@ Add scripts to `package.json`:

Format files:

```sh
::: code-group

```sh [npm]
npm run fmt
```

```sh [pnpm]
pnpm run fmt
```

```sh [yarn]
yarn run fmt
```

```sh [bun]
bun run fmt
```

:::

Check formatting without writing files:

```sh
::: code-group

```sh [npm]
npm run fmt:check
```

```sh [pnpm]
pnpm run fmt:check
```

```sh [yarn]
yarn run fmt:check
```

```sh [bun]
bun run fmt:check
```

:::

## Usage

```sh
Expand Down
66 changes: 63 additions & 3 deletions src/docs/guide/usage/linter/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,48 @@ Add lint commands to `package.json`:

Run it:

```sh
::: code-group

```sh [npm]
npm run lint
```

```sh [pnpm]
pnpm run lint
```

```sh [yarn]
yarn run lint
```

```sh [bun]
bun run lint
```

:::

Apply fixes:

```sh
::: code-group

```sh [npm]
npm run lint:fix
```

```sh [pnpm]
pnpm run lint:fix
```

```sh [yarn]
yarn run lint:fix
```

```sh [bun]
bun run lint:fix
```

:::

## Usage

For the complete list of options, see the [CLI reference](/docs/guide/usage/linter/cli.html).
Expand All @@ -68,14 +100,42 @@ If `PATH` is omitted, Oxlint lints the current working directory.

### Pre-commit with [lint-staged](https://github.com/lint-staged/lint-staged)

```json [package.json]
::: code-group

```json [npm]
{
"lint-staged": {
"*.{js,jsx,ts,tsx,mjs,cjs}": "npm run lint"
}
}
```

```json [pnpm]
{
"lint-staged": {
"*.{js,jsx,ts,tsx,mjs,cjs}": "pnpm run lint"
}
}
```

```json [yarn]
{
"lint-staged": {
"*.{js,jsx,ts,tsx,mjs,cjs}": "yarn run lint"
}
}
```

```json [bun]
{
"lint-staged": {
"*.{js,jsx,ts,tsx,mjs,cjs}": "bun run lint"
}
}
```

:::

### Create a config file

Initialize the `.oxlintrc.json` config with default values:
Expand Down