Shared Prettier configuration.
Use the following command to install @risedle/prettier-config
:
# npm
npm install --save-dev --save-exact prettier @risedle/prettier-config@latest
# pnpm
pnpm add --save-dev --save-exact prettier @risedle/prettier-config@latest
Add the following fields in your package.json
:
{
"scripts": {
"check": "prettier --check ."
},
"prettier": "@risedle/prettier-config"
}
Note You can ignore files by adding it to
.prettierignore
.
Then you can use pnpm check
or npm run check
to check the file formatting.