Getting prettier to work with Tailswind
Published at
This TIL is more than a year old. Some details may have changed.
Getting Prettier to run was not easy. This seemed to do the trick.
.prettierrc
{
"tailwindConfig": "./tailwind.config.js",
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"]
}settings.json
{
"prettier.requireConfig": true,
"prettier.documentSelectors": ["**/*.svelte"],
"[svelte]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}