Is there an existing issue for this?
Description Overview
The no-unknown-property rule only recognizes onTransitionEnd and onTransitionEndCapture from the CSS Transition events, but does not recognize the remaining standard transition event handlers.
These are valid DOM events listed on MDN's Element interface and are properly typed in @types/react (DefinitelyTyped source).
Missing event handlers (6):
onTransitionCancel
onTransitionCancelCapture
onTransitionRun
onTransitionRunCapture
onTransitionStart
onTransitionStartCapture
Reproduction:
// All of these trigger "Unknown property" warnings:
<div onTransitionCancel={() => {}} />
<div onTransitionCancelCapture={() => {}} />
<div onTransitionRun={() => {}} />
<div onTransitionRunCapture={() => {}} />
<div onTransitionStart={() => {}} />
<div onTransitionStartCapture={() => {}} />
These should be added to the DOM_PROPERTY_NAMES_TWO_WORDS array in lib/rules/no-unknown-property.js, alongside the already recognized onTransitionEnd and onTransitionEndCapture.
Note: there may be other missing event handlers following the same pattern (e.g. onAnimationCancel / onAnimationCancelCapture). The scope of this issue is focused on the transition events, but a broader audit of the event handler list against the current MDN Element interface and @types/react might be worthwhile.
Expected Behavior
The rule should recognize all standard CSS Transition event handlers without reporting them as unknown properties. Using onTransitionCancel, onTransitionRun, or onTransitionStart (and their Capture variants) on a DOM element should not trigger a warning.
eslint-plugin-react version
v7.37.5
eslint version
v10.1.0
node version
v24.14.0
Is there an existing issue for this?
Description Overview
The
no-unknown-propertyrule only recognizesonTransitionEndandonTransitionEndCapturefrom the CSS Transition events, but does not recognize the remaining standard transition event handlers.These are valid DOM events listed on MDN's
Elementinterface and are properly typed in@types/react(DefinitelyTyped source).Missing event handlers (6):
onTransitionCancelonTransitionCancelCaptureonTransitionRunonTransitionRunCaptureonTransitionStartonTransitionStartCaptureReproduction:
These should be added to the
DOM_PROPERTY_NAMES_TWO_WORDSarray inlib/rules/no-unknown-property.js, alongside the already recognizedonTransitionEndandonTransitionEndCapture.Note: there may be other missing event handlers following the same pattern (e.g.
onAnimationCancel/onAnimationCancelCapture). The scope of this issue is focused on the transition events, but a broader audit of the event handler list against the current MDNElementinterface and@types/reactmight be worthwhile.Expected Behavior
The rule should recognize all standard CSS Transition event handlers without reporting them as unknown properties. Using
onTransitionCancel,onTransitionRun, oronTransitionStart(and theirCapturevariants) on a DOM element should not trigger a warning.eslint-plugin-react version
v7.37.5
eslint version
v10.1.0
node version
v24.14.0