eslint-plugin-twl
v0.4.3
Published
ESLint rules for twl class name templates: Tailwind class sorting within comment groups, and the compiler's constraints caught in the editor
Maintainers
Readme
eslint-plugin-twl
ESLint rules for twl class name templates. For
Oxlint, use oxlint-plugin-twl.
pnpm add -D eslint-plugin-twl// eslint.config.js
import twl from 'eslint-plugin-twl'
export default [
twl.configs.recommended,
{ settings: { twl: { stylesheet: './src/app.css' } } },
]| Rule | Recommended | Fixable |
| --------------------------------- | ----------- | ------- |
| twl/sort-classes | warn | yes |
| twl/no-interpolation-in-comment | error | |
| twl/no-namespace-import | error | |
| twl/no-shadowed-macro | error | |
twl/sort-classes sorts by Tailwind's order within each group: a // comment,
an interpolation, or a blank line starts a new group, and whitespace stays in
place. It needs settings.twl.stylesheet, a Tailwind CSS v4 entry file, and
@tailwindcss/node installed.
settings.twl.from (default ['twl/macro']) lists the macro modules, as the
compiler's from option.
See the docs, one page per rule.
