I think this problem might be caused by changes in Prettier v3.0. You can try fixing it by going back to Prettier v2.8.8 with these steps:

npm uninstall prettier prettier-plugin-tailwindcss

npm install -D [email protected] [email protected]

Plugin is incompatible with Prettier v3.0 - github issue

Edit:

As of the prettier-plugin-tailwindcss version 0.5.4, this issue should now be resolved. You can update your dependencies with the following commands:

npm install -D prettier prettier-plugin-tailwindcss

Additionally, don't forget to include the following configuration in your prettier.config.js file:

module.exports = {
  plugins: ['prettier-plugin-tailwindcss'],
}

Lastly, make sure to reload Visual Studio Code for the changes to take effect. For more information, please refer to this GitHub comment.

Answer from Artem Purundzhian on Stack Overflow
🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss
GitHub - tailwindlabs/prettier-plugin-tailwindcss: A Prettier plugin for Tailwind CSS that automatically sorts classes based on our recommended class order. · GitHub
To get started, install prettier-plugin-tailwindcss as a dev-dependency: npm install -D prettier prettier-plugin-tailwindcss
Starred by 7K users
Forked by 175 users
Languages   TypeScript 97.6% | JavaScript 2.4%
🌐
npm
npmjs.com › package › prettier-plugin-tailwindcss
prettier-plugin-tailwindcss - npm
A Prettier plugin for sorting Tailwind CSS classes.. Latest version: 0.7.2, last published: 3 months ago. Start using prettier-plugin-tailwindcss in your project by running `npm i prettier-plugin-tailwindcss`. There are 640 other projects in ...
      » npm install prettier-plugin-tailwindcss
    
🌐
npm
npmjs.com › package › prettier-plugin-tailwind-css
prettier-plugin-tailwind-css - npm
It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary. This plugin adds support for the Tailwind CSS library.
      » npm install prettier-plugin-tailwind-css
    
🌐
Tailwind CSS
tailwindcss.com › blog › automatic-class-sorting-with-prettier
Automatic Class Sorting with Prettier - Tailwind CSS
To get started, install prettier-plugin-tailwindcss as a dev-dependency: npm install -D prettier prettier-plugin-tailwindcss
🌐
npm
npmjs.com › package › prettier-plugin-tailwind
prettier-plugin-tailwind - npm
Sort tailwind classes with Prettier. ... This plugin reads your tailwind.config.js to sort tailwind classes in your project.
      » npm install prettier-plugin-tailwind
    
Published   Jun 21, 2021
Version   2.2.12
Author   Ari Seyhun
🌐
Snyk
snyk.io › snyk vulnerability database › npm
prettier-plugin-tailwindcss - npm package
We found that prettier-plugin-tailwindcss demonstrates a positive version release cadence with at least one new version released in the past 3 months. As a healthy sign for on-going project maintenance, we found that the GitHub repository had at least 1 pull request or issue interacted with by the community. ... The npm package prettier-plugin-tailwindcss receives a total of 1,705,634 downloads a week.
Find elsewhere
🌐
DEV Community
dev.to › lazysock › i-made-a-prettier-plugin-that-sorts-your-tailwind-classes-randomly-lpg
I made a Prettier plugin that sorts your Tailwind classes... randomly! - DEV Community
August 15, 2024 - Install prettier and prettier-plugin-tailwindcss-anarchy: npm install -D prettier prettier-plugin-tailwindcss-anarchy
🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss › releases
Releases · tailwindlabs/prettier-plugin-tailwindcss
A Prettier plugin for Tailwind CSS that automatically sorts classes based on our recommended class order. - Releases · tailwindlabs/prettier-plugin-tailwindcss
Author   tailwindlabs
🌐
UNPKG
unpkg.com › browse › prettier-plugin-tailwindcss@0.1.13 › README.md
prettier-plugin-tailwindcss/README.md
## Installation To get started, just install `prettier-plugin-tailwindcss` as a dev-dependency: ```sh npm install -D prettier prettier-plugin-tailwindcss ``` This plugin follows Prettier’s autoloading convention, so as long as you’ve got Prettier set up in your project, it’ll start working automatically as soon as it’s installed.
🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss › issues › 176
Plugin is incompatible with Prettier v3.0 · Issue #176 · tailwindlabs/prettier-plugin-tailwindcss
March 15, 2023 - What version of prettier-plugin-tailwindcss are you using? v0.3.0 What version of Tailwind CSS are you using? v3.3.2 What version of Node.js are you using? v18.16.0 What package manager are you using? npm What operating system are you us...
Author   rahmat-dev
🌐
Roots Discourse
discourse.roots.io › sage
Lost trying to get prettier-plugin-tailwindcss working - sage - Roots Discourse
October 22, 2022 - I’m new to Sage 10 so forgive me If I am missing something glaring. I cannot seem to get prettier for tailwindcss working. I have installed the plugins: npm install -D prettier prettier-plugin-tailwindcss I have updated my tailwind.config.cjs plugins: [ require("prettier-plugin-tailwindcss"), require("@tailwindcss/aspect-ratio"), ], bud development compiles without error but classes are not getting sorted.
🌐
jsDelivr
jsdelivr.com › package › npm › @luewell › prettier-plugin-tailwindcss
@luewell/prettier-plugin-tailwindcss CDN by jsDelivr - A CDN for npm and GitHub
October 14, 2022 - A free, fast, and reliable CDN for @luewell/prettier-plugin-tailwindcss. A Prettier plugin for sorting Tailwind CSS classes.
Published   Oct 14, 2022
🌐
GitHub
gist.github.com › SAMURAii-7 › 62efd5ba5fcd78bcab223626a33c5eaa
Setup Prettier with ESLint and Tailwind CSS · GitHub
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 ...
🌐
Tessl
tessl.io › registry › tessl › npm-prettier-plugin-tailwindcss › 0.6.0
tessl/npm-prettier-plugin-tailwindcss@0.6.x - Registry - Tessl
Package Name: prettier-plugin-tailwindcss · Package Type: npm · Language: TypeScript · Installation: npm install -D prettier-plugin-tailwindcss · This plugin is automatically loaded by Prettier when configured.