Skip to content

Commit 4de38ef

Browse files
committed
address comments - remove auto-fixer and adapt tests
1 parent 17f2878 commit 4de38ef

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,6 @@ function checkLiteralValueNode(context, attributeName, node, parentNode, parentN
321321
secondValue,
322322
missingValue: [...siblings].join(', '),
323323
},
324-
fix(fixer) {
325-
if (siblings.size === 1) {
326-
return fixer.replaceTextRange(singleAttributeParts[0].range, `${pairing}\u0020${[...siblings][0]}`);
327-
}
328-
},
329324
});
330325
}
331326
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
387387
],
388388
},
389389
{
390-
code: '<a rel="noreferrer  noopener"></a>', // this string contains nbsp
390+
code: '<a rel="noreferrer\xa0\xa0noopener"></a>',
391391
output: '<a rel="noreferrer noopener"></a>',
392392
errors: [
393393
{
@@ -562,7 +562,6 @@ ruleTester.run('no-invalid-html-attribute', rule, {
562562
},
563563
{
564564
code: '<link rel="shortcut"></link>',
565-
output: '<link rel="shortcut icon"></link>',
566565
errors: [
567566
{
568567
messageId: 'notAlone',
@@ -575,7 +574,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
575574
},
576575
{
577576
code: '<link rel="shortcut foo"></link>',
578-
output: '<link rel="shortcut icon "></link>',
577+
output: '<link rel="shortcut "></link>',
579578
errors: [
580579
{
581580
messageId: 'neverValid',
@@ -606,7 +605,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
606605
},
607606
{
608607
code: '<link rel="shortcut foo"></link>',
609-
output: '<link rel="shortcut icon "></link>',
608+
output: '<link rel="shortcut foo"></link>',
610609
errors: [
611610
{
612611
messageId: 'neverValid',

0 commit comments

Comments
 (0)