ESLint plugin for Tailwind CSS usage
eslint-plugin-tailwindcss is a tool that enforces best practices and consistency in using Tailwind CSS. It goes beyond the official plugin prettier-plugin-tailwindcss by offering more than 5 additional rules to benefit from.
To install eslint-plugin-tailwindcss, you can add it as a dev dependency in your project using npm:
npm install eslint-plugin-tailwindcss --save-dev
Then configure it in your ESLint configuration file, such as .eslintrc
:
{
"plugins": ["tailwindcss"],
"rules": {
"tailwindcss/classnames-order": "warn",
"tailwindcss/enforces-negative-arbitrary-values": "error",
// Add other rules as needed
}
}
eslint-plugin-tailwindcss is a valuable tool for enforcing best practices and consistency when working with Tailwind CSS. With its various rules, it helps developers maintain a clean and standardized codebase, making it easier to collaborate on projects and ensure code quality. By following the installation guide and leveraging its features, developers can enhance their development workflow and improve the overall quality of their Tailwind CSS projects.