github schoero/eslint-plugin-better-tailwindcss v2.0.0

latest releases: v4.3.2, v4.3.1, v4.3.0...
12 months ago

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 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"
       ]
     }

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 improved sorting 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 $.
  • ⚠️ Enable no-duplicate-classes by default (#67)

  • ⚠️ Change default multiline grouping to newLine (#68)

  • ⚠️ Rename classAttributes to attributes (#69)

Don't miss a new eslint-plugin-better-tailwindcss release

NewReleases is sending notifications on new releases.