Skip to content

Ignore files

Oxfmt provides several ways to exclude files from formatting.

Some ignore mechanisms apply globally, while others are scoped to the config file they belong to:

MechanismScope
CLI paths with ! prefixGlobal
.prettierignore / --ignore-pathGlobal
ignorePatterns in configScoped to that config

When using nested config, ignorePatterns only applies to files that are resolved by that particular config file. Global mechanisms always apply regardless of which config file is in effect.

ignorePatterns

The recommended way to ignore files. Add to your Oxfmt config:

json
{
  "ignorePatterns": ["dist/**", "*.min.js"]
}
``````ts [oxfmt.config.ts]
import { defineConfig } from "oxfmt";

export default defineConfig({
  ignorePatterns: ["dist/**", "*.min.js"],
});