Skip to content

Commit 47078bd

Browse files
committed
[Fix] no-unknown-property: add onScrollEnd and onScrollEndCapture events as known properties
1 parent 73c4c61 commit 47078bd

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1212
### Fixed
1313
* [`no-unknown-property`]: allow `onLoad` on `body` ([#3923][] @DerekStapleton)
1414
* [`no-unknown-property`]: allow `closedby` on `dialog` ([#3980][] @ljharb)
15+
* [`no-unknown-property`]: add `onScrollEnd` and `onScrollEndCapture` events as known properties ([#3958][] @xfeeefeee)
1516

1617
### Changed
1718
* [Docs] [`no-array-index-key`]: add template literal examples ([#3978][] @akahoshi1421)
1819

1920
[#3978]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3978
21+
[#3958]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3958
2022
[#3980]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3980
2123
[#3930]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3930
2224
[#3923]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3923

lib/rules/no-unknown-property.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
265265
'onCompositionUpdate', 'onCut', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave',
266266
'onError', 'onFocus', 'onInput', 'onKeyDown', 'onKeyPress', 'onKeyUp', 'onLoad', 'onWheel', 'onDragOver',
267267
'onDragStart', 'onDrop', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver',
268-
'onMouseUp', 'onPaste', 'onScroll', 'onSelect', 'onSubmit', 'onBeforeToggle', 'onToggle', 'onTransitionEnd', 'radioGroup',
268+
'onMouseUp', 'onPaste', 'onScroll', 'onScrollEnd', 'onSelect', 'onSubmit', 'onBeforeToggle', 'onToggle', 'onTransitionEnd', 'radioGroup',
269269
'readOnly', 'referrerPolicy', 'rowSpan', 'srcDoc', 'srcLang', 'srcSet', 'useMap', 'fetchPriority',
270270
// SVG attributes
271271
// See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
@@ -315,7 +315,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
315315
'onEndedCapture', 'onLoadedDataCapture', 'onLoadedMetadataCapture', 'onLoadStartCapture', 'onPauseCapture', 'onPlayCapture',
316316
'onPlayingCapture', 'onProgressCapture', 'onRateChangeCapture', 'onSeekedCapture', 'onSeekingCapture', 'onStalledCapture', 'onSuspendCapture',
317317
'onTimeUpdateCapture', 'onVolumeChangeCapture', 'onWaitingCapture', 'onSelectCapture', 'onTouchCancelCapture', 'onTouchEndCapture',
318-
'onTouchMoveCapture', 'onTouchStartCapture', 'onScrollCapture', 'onWheelCapture', 'onAnimationEndCapture', 'onAnimationIteration',
318+
'onTouchMoveCapture', 'onTouchStartCapture', 'onScrollCapture', 'onScrollEndCapture', 'onWheelCapture', 'onAnimationEndCapture', 'onAnimationIteration',
319319
'onAnimationStartCapture', 'onTransitionEndCapture',
320320
'onAuxClick', 'onAuxClickCapture', 'onClickCapture', 'onContextMenuCapture', 'onDoubleClickCapture',
321321
'onDragCapture', 'onDragEndCapture', 'onDragEnterCapture', 'onDragExitCapture', 'onDragLeaveCapture',

tests/lib/rules/no-unknown-property.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ ruleTester.run('no-unknown-property', rule, {
4848
// Some HTML/DOM elements with common attributes should work
4949
{ code: '<div className="bar"></div>;' },
5050
{ code: '<div onMouseDown={this._onMouseDown}></div>;' },
51+
{ code: '<div onScrollEnd={this._onScrollEnd}></div>;' },
52+
{ code: '<div onScrollEndCapture={this._onScrollEndCapture}></div>;' },
5153
{ code: '<a href="someLink" download="foo">Read more</a>' },
5254
{ code: '<area download="foo" />' },
5355
{ code: '<img src="cat_keyboard.jpeg" alt="A cat sleeping on a keyboard" align="top" fetchPriority="high" />' },

0 commit comments

Comments
 (0)