This rule reports a style.viewTransition() definition that the compiler cannot
read, such as an unknown field. Each field must name a snapshot pseudo-element,
so an unknown field produces no CSS.
Reported
const transition = style.viewTransition({ before: "opacity-0" });invalid-view-transition-definition: view transition keys must be `group`, `old`, `new`, or `imagePair`
style(transition.for("card"));Fixed
const transition = style.viewTransition({ old: "opacity-0" });
style(transition.for("card"));How to fix
- Use the fields
group,imagePair,old, andnew.oldstyles the snapshot before the update, andnewstyles the snapshot after it. - Write each field as a utility string literal.
Rule settings
| Preset | Severity |
|---|---|
recommended | deny |
strict | deny |
stylistic | off |
Configure lint to change the severity or options.