This version includes a major rewrite of the internal architecture, improving performance and maintainability, resolving long-standing issues, and preparing the codebase for the future and for oxlint.
New Features
- New rule:
enforce-canonical-classes(#232) - New options for
enforce-consistent-class-orderto sort "component classes" and "unknown classes" (#263)detectComponentClasses:booleancomponentClassOrder:"asc" | "desc" | "preserve"componentClassPosition:"start" | "end"unknownClassOrder:"asc" | "desc" | "preserve"unknownClassPosition:"start" | "end"
- Added
strictness: "loose"option toenforce-consistent-line-wrappingto improve interoperability with prettier (#260) - Better Performance
- Oxlint support
⚠️ Breaking Changes
First of all, the minimum required Node.js version is has changed to support v23.0.0, v22.12.0, v20.19.0 to support require(esm)
- This made it possible to remove the
CommonJSbuild (#264)
Some rules have been renamed to better reflect their intentions:
- Renamed rule
no-unregistered-classestono-unknown-classes - Renamed rule
sort-classestoenforce-consistent-class-order - Renamed rule
multilinetoenforce-consistent-line-wrapping
The rule recommendations have been updated to enable new rules by default. Check the updated rule recommendations for more information.
For some rules, the options have been renamed or changed:
- Options for
better-tailwindcss/enforce-consistent-variable-syntaxhave been renamed toshorthandandvariable. - The default for
enforce-consistent-important-positionis now alwaysrecommended. - Renamed the
improvedsorting order forenforce-consistent-class-ordertostrict(#245)improvedis no longer the default option as most people expect the order to match the official order from tailwind.- the
improvedorder got renamed tostrictto better describe its intentions. - the logic of the
strictorder has changed:- Classes that share the same base variants get grouped together.
- Classes with less variants come before classes with more variants.
- Classes with arbitrary variants come last.
- The
enforce-consistent-line-wrappingrule now groups variants more strictly. Previously it only grouped classes by their first variant. Now all variants are ordered correctly.
The configs have been renamed and updated to match the recommended shape of ESLint.
- Renamed configs (#244)
- The following configs are now exposed:
recommendedrecommended-warnrecommended-errorstylisticstylistic-warnstylistic-errorcorrectnesscorrectness-warncorrectness-errorlegacy-recommendedlegacy-recommended-warnlegacy-recommended-errorlegacy-stylisticlegacy-stylistic-warnlegacy-stylistic-errorlegacy-correctnesslegacy-correctness-warnlegacy-correctness-error
- Please check the updated Parser Documentation to see the recommended way to set up the plugin with your parser.
- The following configs are now exposed:
Other changes:
- Function
getDefaultIgnoredUnregisteredClasses()has been removed. - Removed rule regex matchers
- Preserve normal quotes whenever possible (#246)
Here is the full list of changes in this version:
Features
- New rule:
enforce-canonical-classes(#232) - Oxlint support (#284
- Add
strictness: "loose"option toenforce-consistent-line-wrapping(#260) - Add settings option to configure
messageStyle(#276) - angular: Support bound attribute classes (#277)
- svelte: Support class directive (#278)
Fixes
- Don't match attribute values for bound attribute names (#291)
- Correctly override shared settings with rule options (#289)
- Invalid variant grouping order (#282)
- Ignore variants in custom component classes (#258)
- Angular line wrapping (#259)
Refactors
Documentation
- Add
detectComponentClassesto settings (388103e) - Add attribute matcher example (#272)
- Improve configuration guide (bd873ea)
⚠️ Breaking Changes
- ⚠️ Ignore indexed access keys (#292)
- ⚠️ Update rule recommendations (#280)
- ⚠️ Remove separate
CommonJSbuild (#264)
Minimum Node.js version to v23.0.0, v22.12.0, v20.19.0 to supportrequire(esm) - ⚠️ Preserve normal quotes whenever possible (#246)
- ⚠️ Renamed the
improvedsorting order tostrict(#245) - ⚠️ Rename configs (#244)
- ⚠️ Renamed rule
no-unregistered-classestono-unknown-classes - ⚠️ Renamed rule
sort-classestoenforce-consistent-class-order - ⚠️ Renamed rule
multilinetoenforce-consistent-line-wrapping - ⚠️ Options for
better-tailwindcss/enforce-consistent-variable-syntaxhave been renamed toshorthandandvariable. - ⚠️ Function
getDefaultIgnoredUnregisteredClasses()has been removed. - ⚠️ The default for
enforce-consistent-important-positionis now alwaysrecommended. If you are on tailwindcss v3 need to manually set it tolegacyto keep it working for tailwindcss v3. - ⚠️ Removed rule regex matchers
❤️ Contributors
- V-iktor (@V-iktor)