Ignore files
Oxfmt provides several ways to exclude files from formatting.
ignorePatterns
The recommended way to ignore files. Add to .oxfmtrc.json:
json
{
"ignorePatterns": ["dist/**", "*.min.js"]
}- Uses
.gitignoresyntax - 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
.gitignorefiles are not read - A
.gitdirectory 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.
