no-will-change-abuse
Warn when will-change is used with broad keywords, too many targets, or expensive layout/paint targets.
What this catchesโ
will-change: allwill-changetarget lists larger than the configured budget- expensive targets such as
width,height,filter, andbox-shadow
Rule optionsโ
| Option | Default | Why |
|---|---|---|
checkExpensiveTargets | true | will-change should not pre-promote expensive layout or paint properties by default. |
disallowKeywords | ["all", "contents", "scroll-position"] | These keywords are too broad for production performance hints. |
ignoreProperties | [] | Allows reviewed project-specific will-change targets. |
maxProperties | 5 | Allows broader reviewed hints while still catching unfocused target lists. |
{
"css-performance-budget/no-will-change-abuse": [
true,
{
"maxProperties": 5,
"checkExpensiveTargets": true,
"disallowKeywords": ["all", "contents", "scroll-position"],
"ignoreProperties": ["background-position"]
}
]
}