This rule reports each use of a utility with the ! modifier once, even when it
emits several important declarations. It also reports !important declarations
in utility definitions. An important declaration wins over styles that would
normally override it, which makes later changes harder. No preset enables this rule.
Reported
const base = style("p-2");
style(base, "p-4!");no-important: the `!` utility modifier is forbiddenFixed
const base = style("p-2");
style(base, "p-4");How to fix
- To override a shared style, pass it as a base. The later utilities win without
!, as in the example. - To win over a stylesheet that you do not control, use the
importantfield of the project instead. See Configuration.
Rule settings
| Preset | Severity |
|---|---|
recommended | off |
strict | off |
stylistic | off |
| Option | Default |
|---|---|
checkImplementation | true |
Configure lint to change the severity or options.