Skip to content

Commit 9da1bb0

Browse files
thomashockadayljharb
authored andcommitted
[New] no-invalid-html-attribute: add support for apple-touch-startup-image rel attributes in link tags
1 parent d36ca2c commit 9da1bb0

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
77

88
### Added
99
* [`sort-prop-types`]: give errors on TS types ([#3615][] @akulsr0)
10+
* [`no-invalid-html-attribute`]: add support for `apple-touch-startup-image` `rel` attributes in `link` tags ([#3638][] @thomashockaday)
1011

1112
### Fixed
1213
* [`jsx-no-leaked-render`]: preserve RHS parens for multiline jsx elements while fixing ([#3623][] @akulsr0)
1314
* [`jsx-key`]: detect conditional returns ([#3630][] @yialo)
1415
* [`jsx-newline`]: prevent a crash when `allowMultilines ([#3633][] @ljharb)
1516

17+
[#3638]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3638
1618
[#3633]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3633
1719
[#3630]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3630
1820
[#3623]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3623

lib/rules/no-invalid-html-attribute.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const getMessageData = require('../util/message');
1717
const rel = new Map([
1818
['alternate', new Set(['link', 'area', 'a'])],
1919
['apple-touch-icon', new Set(['link'])],
20+
['apple-touch-startup-image', new Set(['link'])],
2021
['author', new Set(['link', 'area', 'a'])],
2122
['bookmark', new Set(['area', 'a'])],
2223
['canonical', new Set(['link'])],

tests/lib/rules/no-invalid-html-attribute.js

+6
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ ruleTester.run('no-invalid-html-attribute', rule, {
230230
{
231231
code: '<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon-180x180.png" />',
232232
},
233+
{
234+
code: '<link rel="apple-touch-startup-image" href="launch.png" />',
235+
},
236+
{
237+
code: '<link rel="apple-touch-startup-image" href="iphone5.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" />',
238+
},
233239
{
234240
code: '<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#fff" />',
235241
},

0 commit comments

Comments
 (0)