npm install --save-dev @sanity/prettier-config prettier
Then add it to your package.json
to install it:
},
+ "prettier": "@sanity/prettier-config",
"dependencies": {
If you need to add more plugins, or extend the configuration, you'll need to create a .prettierrc.cjs
, or prettier.config.cjs
, file instead of using the prettier
field in package.json
:
// .prettierrc.cjs or prettier.config.cjs
const preset = require('@sanity/prettier-config')
module.exports = {
...preset,
plugins: [...preset.plugins, 'prettier-plugin-tailwindcss'],
experimentalTernaries: true,
}