From 842b8412b6759e49ae4dd720789cf0c52c28c233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9rence=20Hollander?= Date: Fri, 30 Apr 2021 17:55:38 +0200 Subject: [PATCH] fix(a11y): do not warn if href value is dynamic (#6110) --- src/compiler/compile/nodes/Attribute.ts | 2 +- test/validator/samples/a11y-anchor-has-content/input.svelte | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compiler/compile/nodes/Attribute.ts b/src/compiler/compile/nodes/Attribute.ts index 47efc4b036..ebed483288 100644 --- a/src/compiler/compile/nodes/Attribute.ts +++ b/src/compiler/compile/nodes/Attribute.ts @@ -96,7 +96,7 @@ export default class Attribute extends Node { } get_static_value() { - if (this.is_spread || this.dependencies.size > 0) return null; + if (!this.is_static) return null; return this.is_true ? true diff --git a/test/validator/samples/a11y-anchor-has-content/input.svelte b/test/validator/samples/a11y-anchor-has-content/input.svelte index ca81f90ae8..e246a1e593 100644 --- a/test/validator/samples/a11y-anchor-has-content/input.svelte +++ b/test/validator/samples/a11y-anchor-has-content/input.svelte @@ -1 +1,2 @@ - \ No newline at end of file + +bar