Skip to content

Files

Latest commit

 

History

History
56 lines (40 loc) · 1.18 KB

valid-compile.md

File metadata and controls

56 lines (40 loc) · 1.18 KB

Pattern: Unresolved Svelte warning

Issue: -

Description

This rule uses Svelte compiler to check the source code.

<script>
  /* eslint svelte/valid-compile: "error" */
  let src = 'tutorial/image.gif';
</script>

<!-- ✓ GOOD -->
<img {src} alt="Rick Astley dances." />

<!-- ✗ BAD -->
<img {src} />

Note that we exclude reports for some checks, such as missing-declaration, and dynamic-slot-name, which you can check with different ESLint rules.

🔧 Options

{
  "svelte/valid-compile": [
    "error",
    {
      "ignoreWarnings": false
    }
  ]
}
  • ignoreWarnings ... If set to true, ignores any warnings other than fatal errors reported by the svelte compiler.
<script>
  /* eslint svelte/valid-compile: ["error", { ignoreWarnings: true }] */
  let src = 'tutorial/image.gif';
</script>

<!-- Ignore -->
<img {src} />

🚀 Version

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

🔍 Implementation