OSS ESLint + Prettier plugins

Tailwind Class Grouper

Automatically organize Tailwind CSS classes into semantic groups with inline category comments. Works in ESLint, Prettier, and this live playground.

Install (ESLint)
npm install --save-dev eslint-plugin-tailwind-group

.eslintrc:

{
  "plugins": ["tailwind-group"],
  "rules": {
    "tailwind-group/group-tailwind-classes": [
      "warn",
      {
        "formatInline": false,
        "useClsx": true
      }
    ]
  }
}
Install (Prettier)
npm install --save-dev prettier-plugin-tailwind-group

prettier.config.js:

module.exports = {
  plugins: ['prettier-plugin-tailwind-group'],
  tailwindGroup: true,
  tailwindGroupMinClasses: 4,
  tailwindGroupIncludeComments: true // set false to omit inline category comments
};

Requires Prettier v3 and assumes clsx (or equivalent) is available.

Options
Class Categories

Size – text sizes, w/h, min/max

Layout – flex/grid, position, justify/items

Spacing – margin, padding, space-*

Border – border, ring, outline, rounded

Background – bg-*, gradient, backdrop-*

Text – font, text-*, placeholder-*

Effects – shadow, opacity, transition/animate

States & Variants – hover/focus/dark/responsive

Responsive – sm/md/lg/xl/2xl

Others – unmatched utilities

Playground
Quick Examples:
Click "Format Classes" to see the result...
📊 Class Category Breakdown
Breakdown will appear here...