prettier-ignore

raw JSON →
0.5.0 verified Sat Apr 25 auth: no javascript

A utility package that provides commonly used ignore patterns for Prettier to skip files and folders like pnpm-lock.yaml, dist, coverage, etc. Version 0.5.0 requires Node.js >=20.19.0 and is actively maintained. It packages community-agreed ignore rules that Prettier does not ignore by default, saving users from manually listing them. It is distributed via npm and integrates with Prettier's --ignore-path option.

error Error: Cannot find module 'prettier-ignore'
cause Using require('prettier-ignore') as if it exports a module.
fix
Use require.resolve('prettier-ignore') to get the path or use the file directly.
error Unrecognized option '--ignore path'
cause Typo in option name: '--ignore path' instead of '--ignore-path'.
fix
Use --ignore-path (with hyphen).
breaking Node.js >=20.19.0 is required since version 0.5.0.
fix Upgrade Node.js to >=20.19.0 or stick to version <0.5.0.
gotcha The package does not expose any JavaScript API; it only provides a file.
fix Do not try to import or require the module programmatically; use the file path directly.
gotcha The ignore file is located at node_modules/prettier-ignore/prettierignore, not at the package root.
fix Use the full path: ./node_modules/prettier-ignore/prettierignore.
npm install prettier-ignore
yarn add prettier-ignore
pnpm add prettier-ignore

Shows how to install and use prettier-ignore with Prettier's --ignore-path option.

// Install: npm i prettier-ignore -D
// Then run Prettier with the ignore file:
npx prettier --ignore-path ./node_modules/prettier-ignore/prettierignore --check .