mirror of https://github.com/sveltejs/svelte
[fix] named slots breaks svelte-ignore comments (#8105)
* [fix] Named slots breaks svelte-ignore comments Fixes #8075 * test: add tests * refactor * refactor test Co-authored-by: mojinming <mojinming@cmcm.com> Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>pull/7790/head
parent
4f365f0171
commit
1f021226c5
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
</script>
|
||||
|
||||
<Component>
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div slot='foo' on:click>hi!</div>
|
||||
</Component>
|
@ -0,0 +1 @@
|
||||
[]
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
</script>
|
||||
|
||||
<Component>
|
||||
<div slot='foo' on:click>hi!</div>
|
||||
</Component>
|
@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"code": "a11y-click-events-have-key-events",
|
||||
"message": "A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.",
|
||||
"start": {
|
||||
"character": 78,
|
||||
"column": 1,
|
||||
"line": 6
|
||||
},
|
||||
"end": {
|
||||
"character": 112,
|
||||
"column": 35,
|
||||
"line": 6
|
||||
},
|
||||
"pos": 78
|
||||
}
|
||||
]
|
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
</script>
|
||||
|
||||
<Component>
|
||||
<!-- svelte-ignore unrelated-warning -->
|
||||
<div slot='foo' on:click>hi!</div>
|
||||
</Component>
|
@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"code": "a11y-click-events-have-key-events",
|
||||
"message": "A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.",
|
||||
"start": {
|
||||
"character": 120,
|
||||
"column": 1,
|
||||
"line": 7
|
||||
},
|
||||
"end": {
|
||||
"character": 154,
|
||||
"column": 35,
|
||||
"line": 7
|
||||
},
|
||||
"pos": 120
|
||||
}
|
||||
]
|
Loading…
Reference in new issue