Pattern: Unresolved Svelte warning
Issue: -
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.
{
"svelte/valid-compile": [
"error",
{
"ignoreWarnings": false
}
]
}
ignoreWarnings
... If set totrue
, 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} />
This rule was introduced in eslint-plugin-svelte v0.7.0