eslint-plugin-readable-tailwind
Advanced tools
Changelog
v3.0.0
This version adds 3 new correctness rules to the plugin. To better reflect the new scope of the plugin it was renamed from eslint-plugin-readable-tailwind
to eslint-plugin-better-tailwindcss
. https://github.com/schoero/eslint-plugin-readable-tailwind/issues/86#issuecomment-2855845766
The predefined configs also have been renamed to better reflect their scope.
Plugin renamed to eslint-plugin-better-tailwindcss
Deprecate Regex matchers to simplify the configuration. (#98)
Regex matchers were an early attempt to make the plugin more flexible. However, they were quickly replaced with Matchers which work on the Abstract Syntax Tree and are far more powerful. Support for Regex matchers will be removed in the next major version.
warning
and error
configs have been removed. Use recommended-warn
or recommended-error
instead. (#99)
eslint-plugin-readable-tailwind
with eslint-plugin-better-tailwindcss
:npm uninstall eslint-plugin-readable-tailwind
npm i -D eslint-plugin-better-tailwindcss
- import eslintPluginReadableTailwind from "eslint-plugin-readable-tailwind";
+ import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
rules: {
// enable all recommended rules to warn
- ...eslintPluginReadableTailwind.configs.warning.rules,
+ ...eslintPluginBetterTailwindcss.configs["recommended-warn"].rules,
// enable all recommended rules to error
- ...eslintPluginReadableTailwind.configs.error.rules,
+ ...eslintPluginBetterTailwindcss.configs["recommended-error"].rules,
// or configure rules individually
- "readable-tailwind/multiline": ["warn", { printWidth: 100 }]
+ "better-tailwindcss/multiline": ["warn", { printWidth: 100 }]
}
Changelog
Changelog
v2.0.0
Adds tailwindcss v4 support while keeping support for tailwindcss v3. (#78)
This version contains breaking changes. Most notably support for Node.js < 20 had to be dropped. The other breaking changes are mostly just changes of the default config, that may cause linting errors.
If you use tailwindcss v4, you should specify the entryPoint
of the css based tailwind configuration file for the sort-classes rule or in the settings.
If you have customized the classAttributes
option for any of the rules or via the settings, rename the option to attributes
If you have customized attributes
, callees
, variables
, or tags
, escape any reserved characters for regular expressions in the name as the name is now evaluated as a regular expression.
For example:
{
variables: [
- "$MyVariable"
+ "\\$MyVariable"
]
}
improved
sorting order will no longer sort variants alphabetically, instead it just makes sure that identical variants are grouped together.$
.no-duplicate-classes
by default (#67)multiline
grouping to newLine
(#68)classAttributes
to attributes
(#69)