prettier-plugin-ignored
v1.0.0
Published
A Prettier plugin that adds an 'ignored' language, allowing you to ignore files without listing them in a .prettierignore file.
Downloads
149
Maintainers
Readme
prettier-plugin-ignored
A Prettier plugin that adds an 'ignored' language, allowing you to ignore files without listing them in a .prettierignore
file.
Why is this useful?
While Prettier configs can be shared across multiple repositories via npm packages, .prettierignore
files cannot. This plugin solves that limitation by allowing you to configure which files should be ignored directly in the Prettier config. As a result, you can share ignored files across multiple repositories.
The plugin extends Prettier with a new language called 'ignored'. When Prettier encounters a file with this language, it formats it to be exactly as it was found, effectively ignoring it.
Installation
npm install --save-dev prettier-plugin-ignored
Usage
Add the plugin to your Prettier config and override specific files to use the 'ignored' parser.
For example, here I'm using it to always ignore pnpm-lock.yaml
files and json files in public
directories:
{
"plugins": ["prettier-plugin-ignored"],
// Other config options...
"overrides": [
{
"files": ["pnpm-lock.yaml", "public/**.json"],
"options": {
"parser": "ignored"
}
}
]
}
License
prettier-plugin-ignored is licensed under the ISC license.