Skip to content

Commit

Permalink
[New] no-invalid-html-attribute: add support for `apple-touch-start…
Browse files Browse the repository at this point in the history
…up-image` `rel` attributes in `link` tags
  • Loading branch information
thomashockaday authored and ljharb committed Oct 3, 2023
1 parent d36ca2c commit 9da1bb0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange

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

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

[#3638]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3638
[#3633]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3633
[#3630]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3630
[#3623]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3623
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-invalid-html-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const getMessageData = require('../util/message');
const rel = new Map([
['alternate', new Set(['link', 'area', 'a'])],
['apple-touch-icon', new Set(['link'])],
['apple-touch-startup-image', new Set(['link'])],
['author', new Set(['link', 'area', 'a'])],
['bookmark', new Set(['area', 'a'])],
['canonical', new Set(['link'])],
Expand Down
6 changes: 6 additions & 0 deletions tests/lib/rules/no-invalid-html-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ ruleTester.run('no-invalid-html-attribute', rule, {
{
code: '<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon-180x180.png" />',
},
{
code: '<link rel="apple-touch-startup-image" href="launch.png" />',
},
{
code: '<link rel="apple-touch-startup-image" href="iphone5.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" />',
},
{
code: '<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#fff" />',
},
Expand Down

0 comments on commit 9da1bb0

Please sign in to comment.