eslint-plugin-tailwindcss icon indicating copy to clipboard operation
eslint-plugin-tailwindcss copied to clipboard

[BUG] `[&>button]:bg-opacity-90` should be valid for `migration-from-tailwind-2` rule

Open nghiepdev opened this issue 3 months ago • 1 comments

Describe the bug The code below is currently displaying a warning

Classname '[&>button]:bg-opacity-90' should be replaced by an opacity suffix (eg. '/90')

      <div className="[&>button]:bg-opacity-90">
        <button className="bg-green-400">Login</button>
        <button className="bg-red-500">Register</button>
      </div>

Expected behvior Rule migration-from-tailwind-2 should be valid for child selector: [&>], [&_]

Screenshots image

nghiepdev avatar Apr 14 '24 07:04 nghiepdev

Rule migration-from-tailwind-2 should be valid for child selector: [&>], [&_]

Why do you think so? I’d suggest that this code should be refactored to:

      <div>
        <button className="bg-green-400/90">Login</button>
        <button className="bg-red-500/90">Register</button>
      </div>

kachkaev avatar Apr 19 '24 08:04 kachkaev