Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 1.26 KB

no-undefined-print.md

File metadata and controls

56 lines (35 loc) · 1.26 KB
pageClass sidebarDepth title description since
rule-details
0
svelte/no-undefined-print
Disallow from printing `undefined`
v0.0.1

svelte/no-undefined-print

Disallow from printing undefined

  • ⚙️ This rule is included in "plugin:svelte/recommended".

📖 Rule Details

This rule reports all uses of {@html} in order to reduce the risk of injecting potentially unsafe / unescaped html into the browser leading to Cross-Site Scripting (XSS) attacks.

<script>
  /* eslint svelte/no-at-html-tags: "error" */
</script>

<!-- ✓ GOOD -->
{foo}

<!-- ✗ BAD -->
{@html foo}

🔧 Options

Nothing.

🔇 When Not To Use It

If you are certain the content passed to {@html} is sanitized HTML you can disable this rule.

📚 Further Reading

🚀 Version

This rule was introduced in eslint-plugin-svelte v0.0.1

🔍 Implementation