Skip to content

Commit

Permalink
[Fix] no-unknown-property: controlsList, not controlList
Browse files Browse the repository at this point in the history
Fixes #3397
  • Loading branch information
ljharb committed Sep 5, 2022
1 parent 7ba7ec4 commit 4be5632
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
* [`no-unknown-property`]: avoid warning on `fbt` nodes entirely ([#3391][] @ljharb)
* [`no-unknown-property`]: add `download` property support for `a` and `area` ([#3394][] @HJain13)
* [`no-unknown-property`]: allow `webkitAllowFullScreen` and `mozAllowFullScreen` ([#3396][] @ljharb)
* [`no-unknown-property`]: `controlsList`, not `controlList` ([#3397][] @ljharb)

[#3397]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3397
[#3396]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3396
[#3394]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3394
[#3391]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3391
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 @@ -90,7 +90,7 @@ const ATTRIBUTE_TAGS_MAP = {
// Video related attributes
autoPictureInPicture: ['video'],
controls: ['audio', 'video'],
controlList: ['video'],
controlsList: ['audio', 'video'],
disablePictureInPicture: ['video'],
disableRemotePlayback: ['audio', 'video'],
loop: ['audio', 'video'],
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ ruleTester.run('no-unknown-property', rule, {
{ code: '<path fill="pink" d="M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 z"></path>' },
{ code: '<line fill="pink" x1="0" y1="80" x2="100" y2="20"></line>' },
{ code: '<link as="audio">Audio content</link>' },
{ code: '<video controls={this.controls} loop={true} muted={false} src={this.videoSrc} playsInline={true}></video>' },
{ code: '<audio controls={this.controls} crossOrigin="anonymous" disableRemotePlayback loop muted preload="none" src="something" onAbort={this.abort} onDurationChange={this.durationChange} onEmptied={this.emptied} onEnded={this.end} onError={this.error}></audio>' },
{ code: '<video controlsList="nodownload" controls={this.controls} loop={true} muted={false} src={this.videoSrc} playsInline={true}></video>' },
{ code: '<audio controlsList="nodownload" controls={this.controls} crossOrigin="anonymous" disableRemotePlayback loop muted preload="none" src="something" onAbort={this.abort} onDurationChange={this.durationChange} onEmptied={this.emptied} onEnded={this.end} onError={this.error}></audio>' },

// fbt
{ code: '<fbt desc="foo" doNotExtract />;' },
Expand Down

0 comments on commit 4be5632

Please sign in to comment.