Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] no-unknown-property: add fetchPriority #3697

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
* [`jsx-newline`]: prevent a crash when `allowMultilines ([#3633][] @ljharb)
* [`no-unknown-property`]: use a better regex to avoid a crash ([#3666][] @ljharb @SCH227)
* [`prop-types`]: handle nested forwardRef + memo ([#3679][] @developer-bandi)
* [`no-unknown-property`]: add `fetchPriority` ([#3697][] @SevereCloud)

### Changed
* [Refactor] `propTypes`: extract type params to var ([#3634][] @HenryBrown0)
Expand All @@ -37,6 +38,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
* [Docs] [`iframe-missing-sandbox`]: fix link to iframe attribute on mdn ([#3690][] @nnmrts)
* [Docs] [`hook-use-state`]: fix an undefined variable ([#3626][] @chentsulin)

[#3697]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3697
[#3690]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3690
[#3680]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3680
[#3679]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3679
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
'onError', 'onFocus', 'onInput', 'onKeyDown', 'onKeyPress', 'onKeyUp', 'onLoad', 'onWheel', 'onDragOver',
'onDragStart', 'onDrop', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver',
'onMouseUp', 'onPaste', 'onScroll', 'onSelect', 'onSubmit', 'onToggle', 'onTransitionEnd', 'radioGroup', 'readOnly', 'referrerPolicy',
'rowSpan', 'srcDoc', 'srcLang', 'srcSet', 'useMap',
'rowSpan', 'srcDoc', 'srcLang', 'srcSet', 'useMap', 'fetchPriority',
// SVG attributes
// See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
'crossOrigin', 'accentHeight', 'alignmentBaseline', 'arabicForm', 'attributeName',
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ruleTester.run('no-unknown-property', rule, {
{ code: '<div onMouseDown={this._onMouseDown}></div>;' },
{ code: '<a href="someLink" download="foo">Read more</a>' },
{ code: '<area download="foo" />' },
{ code: '<img src="cat_keyboard.jpeg" alt="A cat sleeping on a keyboard" align="top" />' },
{ code: '<img src="cat_keyboard.jpeg" alt="A cat sleeping on a keyboard" align="top" fetchPriority="high" />' },
{ code: '<input type="password" required />' },
{ code: '<input ref={this.input} type="radio" />' },
{ code: '<input type="file" webkitdirectory="" />' },
Expand Down
Loading