Skip to content

Commit c320b67

Browse files
committed
fix tests
1 parent d3397be commit c320b67

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/rules/no-unescaped-entities.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ module.exports = {
125125
{
126126
data: { alt },
127127
fix(fixer) {
128-
fixer.replaceTextRange([start + index, start + index + 1], alt);
128+
const rangeStart = start + index + 1;
129+
const rangeEnd = rangeStart + 1;
130+
131+
return fixer.replaceTextRange([rangeStart, rangeEnd], alt);
129132
},
130133
}
131134
)),

tests/lib/rules/no-unescaped-entities.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,28 +346,28 @@ ruleTester.run('no-unescaped-entities', rule, {
346346
data: { alt: '"' },
347347
output: `
348348
<script>window.foo = &quot;bar"</script>
349-
`,
349+
`,
350350
},
351351
{
352352
messageId: 'replaceWithAlt',
353353
data: { alt: '&ldquo;' },
354354
output: `
355355
<script>window.foo = &ldquo;bar"</script>
356-
`,
356+
`,
357357
},
358358
{
359359
messageId: 'replaceWithAlt',
360360
data: { alt: '&#34;' },
361361
output: `
362362
<script>window.foo = &#34;bar"</script>
363-
`,
363+
`,
364364
},
365365
{
366366
messageId: 'replaceWithAlt',
367367
data: { alt: '&rdquo;' },
368368
output: `
369369
<script>window.foo = &rdquo;bar"</script>
370-
`,
370+
`,
371371
},
372372
],
373373
},

0 commit comments

Comments
 (0)