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.
Migration
-
If you use tailwindcss v4, you should specify the
entryPointof the css based tailwind configuration file for the sort-classes rule or in the settings. -
If you have customized the
classAttributesoption for any of the rules or via the settings, rename the option toattributes -
If you have customized
attributes,callees,variables, ortags, 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" ] }
Changes
- Reload tailwind config automatically if a change is detected.
- Options now correctly override settings (#66)
⚠️ Breaking Changes
-
⚠️ Drop support for Node.js < 20 due to incompatibility of worker threads.
-
⚠️ Add support for tailwindcss v4 (#25)
- The official class ordering seems to have changed slightly.
- The
improvedsorting order will no longer sort variants alphabetically, instead it just makes sure that identical variants are grouped together.
-
⚠️ Regex names (#63)
- "Names" can now be regular expressions. This is a breaking change, if you have names configured that contain reserved characters in regular expressions like
$.
- "Names" can now be regular expressions. This is a breaking change, if you have names configured that contain reserved characters in regular expressions like
-
⚠️ Enable
no-duplicate-classesby default (#67) -
⚠️ Change default
multilinegrouping tonewLine(#68) -
⚠️ Rename
classAttributestoattributes(#69)