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
19 changes: 18 additions & 1 deletion src/docs/guide/usage/linter/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,31 @@ _\*Note: Supports only the `<script>` content, ignores the rest. For Astro, both

### Ignoring files

You can ignore certain patterns of files by configuring the `ignorePatterns` property in a configuration file. The value of the `ignorePatterns` property is an array of file patterns (globs), which are resolved relative to the location of the configuration file.
#### Files automatically ignored by Oxlint

By default, Oxlint automatically ignores the following:

- **`.git` directories**: Always skipped to avoid linting version control metadata
- **Minified files**: Files containing `.min.`, `-min.`, or `_min.` in their names (e.g., `bundle.min.js`, `vendor-min.js`)
- **Files in `.gitignore`**: Respected even without a Git repository. Note that global `.gitignore` files are NOT respected.
- **Files in `.eslintignore`**: By default, Oxlint reads the `.eslintignore` file in your project root

**Note**: Hidden files (files starting with `.`) are NOT automatically ignored by Oxlint.

#### Custom ignore patterns

You can ignore additional patterns of files by configuring the `ignorePatterns` property in a configuration file. The value of the `ignorePatterns` property is an array of file patterns (globs), which are resolved relative to the location of the configuration file.

```jsonc
{
"ignorePatterns": ["vendor", "test/snapshots/**", "test.js"],
}
```

#### Disabling file ignoring

To disable all automatic file ignoring (including `.gitignore` and `.eslintignore`), use the `--no-ignore` command-line flag. You can also specify a custom ignore file with `--ignore-path` or add additional patterns with `--ignore-pattern`. See the [CLI documentation](./cli.md) for more details.

### .eslintignore

Oxlint works with existing [.eslintignore](https://eslint.org/docs/latest/use/configure/ignore#the-eslintignore-file) files.
2 changes: 1 addition & 1 deletion src/docs/guide/usage/linter/generated-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Arguments:
Disable excluding files from `.eslintignore` files, **`--ignore-path`** flags and **`--ignore-pattern`** flags

> [!NOTE]
> `.gitignore` is only respected inside a Git repository.
> `.gitignore` files are respected even without a Git repository.

## Handle Warnings

Expand Down