This is my personal Prettier configuration.
npm install --save-dev @wkovacs64/prettier-config
Be sure to install the appropriately versioned
prettier
peer dependency as well.
Follow the Prettier documentation on sharing configurations.
{
"prettier": "@wkovacs64/prettier-config",
"scripts": {
...
"format": "prettier --cache --write .",
"format:check": "prettier --cache --check .",
...
}
}
.changeset
package.json
package-lock.json
If you need to customize the configuration, you can use a dedicated Prettier config file instead of the one-liner in package.json:
import prettierConfig from '@wkovacs64/prettier-config';
/** @type {import("prettier").Options} */
export const config = {
...prettierConfig,
// overrides here
};
export default config;