Skip to content

Commit 87fe152

Browse files
committed
[Fix] no-invalid-html-attribute: allow link rel to have apple-touch-icon, mask-icon
Fixes #3132
1 parent 21e01b6 commit 87fe152

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
55

66
## Unreleased
77

8+
### Fixed
9+
* [`no-invalid-html-attribute`]: allow `link` `rel` to have `apple-touch-icon`, `mask-icon` ([#3132][] @ljharb)
10+
11+
[#3132]: https://github.com/yannickcr/eslint-plugin-react/issue/3132
12+
813
## [7.27.0] - 2021.11.09
914

1015
### Added

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const report = require('../util/report');
1515

1616
const rel = new Map([
1717
['alternate', new Set(['link', 'area', 'a'])],
18+
['apple-touch-icon', new Set(['link'])],
1819
['author', new Set(['link', 'area', 'a'])],
1920
['bookmark', new Set(['area', 'a'])],
2021
['canonical', new Set(['link'])],
@@ -24,6 +25,7 @@ const rel = new Map([
2425
['icon', new Set(['link'])],
2526
['license', new Set(['link', 'area', 'a', 'form'])],
2627
['manifest', new Set(['link'])],
28+
['mask-icon', new Set(['link'])],
2729
['modulepreload', new Set(['link'])],
2830
['next', new Set(['link', 'area', 'a', 'form'])],
2931
['nofollow', new Set(['area', 'a', 'form'])],

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,24 @@ ruleTester.run('no-invalid-html-attribute', rule, {
211211
})
212212
`,
213213
},
214+
{
215+
code: '<link rel="apple-touch-icon" sizes="60x60" href="apple-touch-icon-60x60.png" />',
216+
},
217+
{
218+
code: '<link rel="apple-touch-icon" sizes="76x76" href="apple-touch-icon-76x76.png" />',
219+
},
220+
{
221+
code: '<link rel="apple-touch-icon" sizes="120x120" href="apple-touch-icon-120x120.png" />',
222+
},
223+
{
224+
code: '<link rel="apple-touch-icon" sizes="152x152" href="apple-touch-icon-152x152.png" />',
225+
},
226+
{
227+
code: '<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon-180x180.png" />',
228+
},
229+
{
230+
code: '<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#fff" />',
231+
},
214232
],
215233
invalid: [
216234
{

0 commit comments

Comments
 (0)