JSPM

@sanity/prettier-config

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4206
  • Score
    100M100P100Q122645F
  • License MIT

Sanity.io Prettier shared configuration

Package Exports

  • @sanity/prettier-config
  • @sanity/prettier-config/package.json

Readme

@sanity/prettier-config

npm stat npm version

npm install --save-dev @sanity/prettier-config prettier

Then add it to your package.json to install it:

   },
+  "prettier": "@sanity/prettier-config",
   "dependencies": {

When using pnpm you should add this to your .npmrc file:

public-hoist-pattern[]=*prettier*

If you need to add more plugins, or extend the configuration, you'll need to create a prettier.config.mjs, file instead of using the prettier field in package.json:

// prettier.config.mjs

import preset from '@sanity/prettier-config'

export default {
  ...preset,
  plugins: [...preset.plugins, 'prettier-plugin-tailwindcss'],
  experimentalTernaries: true,
}

Format in-browser with our settings