An ESLint plugin to enforce usage of Tailwind CSS utility and component classes.
Install with npm
or yarn
:
npm install --save-dev @jarrodldavis/eslint-plugin-tailwindcss
yarn add --dev @jarrodldavis/eslint-plugin-tailwindcss
In your .eslintrc.json
(or other .eslintrc.*
configuration file):
{
"plugins": ["@jarrodldavis/tailwindcss"],
"rules": {
"@jarrodldavis/tailwindcss/no-unknown-class": "error"
}
}
The same can be accomplished using the recommended
config:
{
"extends": ["plugin:@jarrodldavis/tailwindcss/recommended"]
}
See the rule documentation for details about using and configuring the no-unknown-classes
rule.