# Source: https://oxc.rs/docs/guide/usage/linter/ignore-files.md

# Source: https://oxc.rs/docs/guide/usage/formatter/ignore-files.md

---
url: /docs/guide/usage/formatter/ignore-files.md
---
# Ignore files

Oxfmt provides several ways to exclude files from formatting.

## `ignorePatterns`

The recommended way to ignore files. Add to `.oxfmtrc.json`:

```json [.oxfmtrc.json]
{
  "ignorePatterns": ["dist/**", "*.min.js"]
}
```

* Uses `.gitignore` syntax
* Paths are resolved relative to the directory containing the Oxfmt config file
* Formatter-specific and independent of Git

Files matching `ignorePatterns` **cannot be formatted**, even if explicitly specified.

## `.gitignore`

Oxfmt respects `.gitignore` files in the current directory tree.

* Global gitignore and parent `.gitignore` files are not read
* A `.git` directory is not required

Files ignored by `.gitignore` **can still be formatted** if explicitly specified.

## VCS directories and `node_modules`

Ignored by default: `.git`, `.svn`, `.jj`, `node_modules`

Use `--with-node-modules` to include `node_modules`.

## Lock files

`package-lock.json`, `pnpm-lock.yaml`, etc. are always ignored.

## `.prettierignore`

Supported for Prettier compatibility. Uses `.gitignore` syntax.

Files in `.prettierignore` cannot be formatted, even when explicitly specified.

For new projects, prefer `ignorePatterns`.