Skip to content

Commit 64ad602

Browse files
committed
[Fix] no-unknown-property: add valign on table components
Fixes #3389
1 parent 9de16a7 commit 64ad602

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1616
* [`no-unknown-property`]: allow `imageSrcSet` and `imageSizes` attributes on `<link>` ([#3407][] @terrymun)
1717
* [`no-unknown-property`]: add `border`; `focusable` on `<svg>` ([#3404][] [#3404][] @ljharb)
1818
* [`no-unknown-property`]: React lowercases `data-` attrs ([#3395][] @ljharb)
19+
* [`no-unknown-property`]: add `valign` on table components ([#3389][] @ljharb)
1920

2021
[#3407]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3407
2122
[#3406]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3406
@@ -28,6 +29,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
2829
[#3395]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3395
2930
[#3394]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3394
3031
[#3391]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3391
32+
[#3389]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3389
3133

3234
## [7.31.6] - 2022.09.04
3335

lib/rules/no-unknown-property.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const ATTRIBUTE_TAGS_MAP = {
6363
property: ['meta'],
6464
viewBox: ['svg'],
6565
as: ['link'],
66+
valign: ['tr', 'td', 'th', 'thead', 'tbody', 'tfoot', 'colgroup', 'col'], // deprecated, but known
6667
// Media events allowed only on audio and video tags, see https://github.com/facebook/react/blob/256aefbea1449869620fb26f6ec695536ab453f5/CHANGELOG.md#notable-enhancements
6768
onAbort: ['audio', 'video'],
6869
onCanPlay: ['audio', 'video'],
@@ -88,18 +89,17 @@ const ATTRIBUTE_TAGS_MAP = {
8889
onTimeUpdate: ['audio', 'video'],
8990
onVolumeChange: ['audio', 'video'],
9091
onWaiting: ['audio', 'video'],
91-
scrolling: ['iframe'],
92-
playsInline: ['video'],
93-
// Video related attributes
9492
autoPictureInPicture: ['video'],
9593
controls: ['audio', 'video'],
9694
controlsList: ['audio', 'video'],
9795
disablePictureInPicture: ['video'],
9896
disableRemotePlayback: ['audio', 'video'],
9997
loop: ['audio', 'video'],
10098
muted: ['audio', 'video'],
99+
playsInline: ['video'],
101100
poster: ['video'],
102101
preload: ['audio', 'video'],
102+
scrolling: ['iframe'],
103103
};
104104

105105
const SVGDOM_ATTRIBUTE_NAMES = {

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

+17
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,23 @@ ruleTester.run('no-unknown-property', rule, {
119119
{ code: '<link as="audio">Audio content</link>' },
120120
{ code: '<video controlsList="nodownload" controls={this.controls} loop={true} muted={false} src={this.videoSrc} playsInline={true}></video>' },
121121
{ 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>' },
122+
{
123+
code: `
124+
<table>
125+
<colgroup valign="top">
126+
<col valign="top" />
127+
</colgroup>
128+
<thead valign="top">
129+
<tr valign="top">
130+
<th valign="top">Header</th>
131+
<td valign="top">Cell</td>
132+
</tr>
133+
</thead>
134+
<tbody valign="top" />
135+
<tfoot valign="top" />
136+
</table>
137+
`,
138+
},
122139

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

0 commit comments

Comments
 (0)