Skip to content

Instantly share code, notes, and snippets.

@spring8904
Last active December 28, 2023 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spring8904/3c028f3230a18d0971ab78bace9d074f to your computer and use it in GitHub Desktop.
Save spring8904/3c028f3230a18d0971ab78bace9d074f to your computer and use it in GitHub Desktop.

Prettier

Config

Add to .prettierrc:

{
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "semi": false,
  "singleQuote": true,
  "quoteProps": "as-needed",
  "jsxSingleQuote": false,
  "trailingComma": "all",
  "bracketSpacing": true,
  "bracketSameLine": false,
  "arrowParens": "always",
  "requirePragma": false,
  "insertPragma": false,
  "proseWrap": "preserve",
  "htmlWhitespaceSensitivity": "css",
  "vueIndentScriptAndStyle": false,
  "endOfLine": "lf",
  "embeddedLanguageFormatting": "auto",
  "singleAttributePerLine": false
}

Prettier Plugin Tailwindcss

Install prettier-plugin-tailwindcss:

npm install -D prettier-plugin-tailwindcss

Add to .prettierrc:

{
  ...,
  "plugins": ["prettier-plugin-tailwindcss"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment