mirror of https://github.com/sveltejs/svelte
parent
dc7fd76e53
commit
5b1c866270
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import MyLabel from "./MyLabel.svelte";
|
||||
import MyInput from "./MyInput.svelte";
|
||||
import CustomLabel from "./CustomLabel.svelte";
|
||||
</script>
|
||||
|
||||
<MyLabel>xxx</MyLabel>
|
||||
<CustomLabel>xxx</CustomLabel>
|
||||
<MyLabel><input /></MyLabel>
|
||||
<MyLabel><slot /></MyLabel>
|
||||
<MyLabel><MyInput /></MyLabel>
|
||||
<MyLabel><div><MyInput /></div></MyLabel>
|
||||
<label><div><MyInput /></div></label>
|
||||
@ -0,0 +1,10 @@
|
||||
{
|
||||
"a11y": {
|
||||
"rules": {
|
||||
"label-has-associated-control": {
|
||||
"labelComponents": ["MyLabel"],
|
||||
"controlComponents": ["MyInput"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"code": "a11y-label-has-associated-control",
|
||||
"message": "A11y: A form label must be associated with a control.",
|
||||
"pos": 151,
|
||||
"start": {
|
||||
"character": 151,
|
||||
"column": 0,
|
||||
"line": 7
|
||||
},
|
||||
"end": {
|
||||
"character": 173,
|
||||
"column": 22,
|
||||
"line": 7
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Reference in new issue