Prettier VSCode and TailwindCss auto class sorting

Prettier vsCode and tailwindCss auto class sorting

Why does Prettier not format code in VS Code


Install prettier extension on vscode Click here to install visit Prettier - Code formatter

Open the vscode setting window using File > Preferences > Settings

Shortcut - Settings Window (ctrl + ,)

Search for Editor: Default Formatter and select Prettier-code formatter from drop-down

Search for Editor: Format On Save and activate the format a file on save

Why does Prettier not format code in VS Code?

  1. Check if Prettier is the default formatter by opening settings windows

    Shortcut - Settings Window (ctrl + ,)

  2. If Prettier is already set and still code format is not working, then

    Press ctrl+shift+p > Format Document With... > Configure Default Formatter... > Prettier - Code formatter