Skip to content

Commit 008d9d5

Browse files
authored
add test
1 parent 6dccb7d commit 008d9d5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/unescaped-html-literal.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ ruleTester.run('unescaped-html-literal', rule, {
5757
},
5858
],
5959
},
60+
{
61+
code: "const helloHTML = ` \n\t<div>Hello ${name}!</div>`",
62+
parserOptions: {ecmaVersion: 2017},
63+
errors: [
64+
{
65+
message: 'Unescaped HTML literal. Use html`` tag template literal for secure escaping.',
66+
type: 'TemplateLiteral',
67+
},
68+
],
69+
},
6070
{
6171
code: 'const helloHTML = foo`<div>Hello ${name}!</div>`',
6272
parserOptions: {ecmaVersion: 2017},

0 commit comments

Comments
 (0)