Registry / devops / prettier-ignore

prettier-ignore

JSON →
library0.5.0jsnpmunverified

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.

npm install prettier-ignore
INSTALL
IMPORT
SIG · PRETTIER-IGNORE
P
prettier-ignore
devopsjavascriptv0.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

prettierignore
const path = require('path'); const ignorePath = path.join(require.resolve('prettier-ignore'), '../prettierignore');
import { prettierignore } from 'prettier-ignore';
The package provides a file, not a JS export. Use the file path directly.
prettier-ignore/prettierignore
npx prettier --ignore-path ./node_modules/prettier-ignore/prettierignore
npx prettier --ignore path ./node_modules/prettier-ignore/prettierignore
The option is --ignore-path (with hyphen, not space).
require('prettier-ignore')
const ignorePath = require.resolve('prettier-ignore')
const ignore = require('prettier-ignore');
require() returns the module's main entry (if any), not the ignore file. Use require.resolve to get the directory path.

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 .
Debug
Known issues
breakingNode.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.
affects: >=0.5.0
gotchaThe 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.
affects: >=0.0.0
gotchaThe 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.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'prettier-ignore'
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.
Unrecognized option '--ignore path'
Typo in option name: '--ignore path' instead of '--ignore-path'.
fix
Use --ignore-path (with hyphen).
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
prettier-ignore — npm install prettier-ignore · libregistry