prettier-sveltekit Svelte Themes

Prettier Sveltekit

@anuarhdz/prettier-sveltekit

Prettier config for SvelteKit projects with Tailwind CSS and Svelte plugin support.

Installation

npm install -D prettier prettier-plugin-svelte prettier-plugin-tailwindcss @anuarhdz/prettier-sveltekit

Usage

Option A — via package.json (no config file needed):

{
  "prettier": "@anuarhdz/prettier-sveltekit"
}

Option B — via prettier.config.js (to extend or add project-specific options):

import baseConfig from "@anuarhdz/prettier-sveltekit"

export default {
  ...baseConfig,
  tailwindStylesheet: "./src/routes/+layout.css",
}

tailwindStylesheet is project-specific (path varies per project) so it is not included in the base config.

Config

Option Value
useTabs false
singleQuote false
trailingComma "es5"
semi false
printWidth 90
bracketSameLine true
svelteBracketNewLine true
plugins prettier-plugin-svelte, prettier-plugin-tailwindcss
overrides *.svelteparser: "svelte"
tailwindFunctions cva, cx, cn, tv, clsx

Top categories

Loading Svelte Themes