https://github.com/tobysmith568/prettier-plugin-ignored
A Prettier plugin that adds an 'ignored' language, allowing you to ignore files without listing them in a .prettierignore file.
https://github.com/tobysmith568/prettier-plugin-ignored
formatter formatting npm-package prettier prettier-plugin
Last synced: 10 months ago
JSON representation
A Prettier plugin that adds an 'ignored' language, allowing you to ignore files without listing them in a .prettierignore file.
- Host: GitHub
- URL: https://github.com/tobysmith568/prettier-plugin-ignored
- Owner: tobysmith568
- License: isc
- Created: 2024-08-29T21:01:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-02T21:27:15.000Z (11 months ago)
- Last Synced: 2025-06-03T11:58:21.355Z (11 months ago)
- Topics: formatter, formatting, npm-package, prettier, prettier-plugin
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/prettier-plugin-ignored
- Size: 224 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
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
```pwsh
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:
```jsonc
{
"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](./LICENSE.md).