npm install prettier prettier-plugin-tailwindcss eslint-config-prettier
OR
yarn add prettier prettier-plugin-tailwindcss eslint-config-prettier
- Create
.prettierrc
in the root directory of your project - Type the following to include the prettier tailwind css plugin and any other formatting rules.
{ "tabWidth": 4, "semi": false, "plugins": ["prettier-plugin-tailwindcss"] }
- open .eslintrc.json
- Add
"prettier"
at the end of the extends array so it can override any other configs{ "extends": ["other-configs", "prettier"] }
npx prettier --write .
OR
yarn prettier --write .