A shared Prettier configuration.
Install Prettier, the required plugins, and the @simbo/prettier-config
from
the npm registry:
npm i -D prettier @ianvs/prettier-plugin-sort-imports prettier-plugin-organize-attributes @simbo/prettier-config
Create a Prettier configuration file in the root of your project.
echo '"@simbo/prettier-config"' > .prettierrc
Add prettier
commands to your package.json
scripts:
"check:format": "prettier --check .",
"fix:format": "prettier --write .",
And your done. 🍻
.prettierrc
"@simbo/prettier-config"
.prettierrc.js
Extending the shared configuration is only possible using JavaScript or TypeScript.
import simboPrettierConfig from '@simbo/prettier-config';
/**
* @see https://prettier.io/docs/configuration
* @type {import("prettier").Config}
*/
export default {
...simboPrettierConfig,
// add custom settings here
};