ESLint plugin with formatting and linting rules to write cleaner, more maintainable Tailwind CSS.
eslint-plugin-better-tailwindcss is an ESLint plugin that provides formatting and linting rules specifically for Tailwind CSS. It automatically formats Tailwind class strings for readability and enforces best practices to catch errors, helping developers write cleaner and more maintainable code. The plugin supports a wide range of frameworks and integrates with popular Tailwind utility libraries.
Frontend developers using Tailwind CSS in projects across frameworks like React, Vue, Svelte, or Astro, who want to enforce consistent styling and avoid common Tailwind pitfalls.
Developers choose this plugin because it offers a comprehensive, automated solution for Tailwind CSS code quality, combining both formatting and linting in one tool. Its broad framework support and pre-configured utility integrations save setup time and ensure consistent enforcement across teams.
ESLint/Oxlint plugin to help you write better tailwindcss by improving readability with formatting rules and enforcing best practices with linting rules.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically breaks long Tailwind strings into readable lines and enforces consistent ordering, as shown in the demo image, reducing manual formatting effort.
Works with React, Vue, Svelte, Astro, and many others, making it versatile for diverse frontend stacks without needing separate plugins.
Pre-configured to lint classes from popular utilities like clsx, cva, and tailwind-merge, saving setup time and ensuring consistency across helper functions.
Offers recommended configs with adjustable error/warning levels, allowing teams to tailor strictness based on project needs, as detailed in the rules table.
Requires installing and configuring separate parsers for each file type (e.g., .vue, .svelte), adding complexity to initial setup, as noted in the Quick Start section.
Only compatible with ESLint or Oxlint, limiting adoption in projects using other linting tools like Stylelint or custom setups.
Some rules, such as 'no-conflicting-classes', only support Tailwind v4, reducing functionality for teams stuck on older versions, as indicated in the rules compatibility table.