Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add aria-proptype validation to compiler
- Loading branch information
Showing
11 changed files
with
997 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/validator/samples/a11y-aria-proptypes-drag-and-drop/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<span aria-dropeffect="copy execute badvalue">foo</span> | ||
<span aria-grabbed="yes">foo</span> |
33 changes: 33 additions & 0 deletions
33
test/validator/samples/a11y-aria-proptypes-drag-and-drop/warnings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[ | ||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"end": { | ||
"character": 45, | ||
"column": 45, | ||
"line": 1 | ||
}, | ||
"message": "A11y: The value for the aria attribute 'aria-dropeffect' must be a space-separated list of one or more of copy, execute, link, move, none, popup", | ||
"pos": 6, | ||
"start": { | ||
"character": 6, | ||
"column": 6, | ||
"line": 1 | ||
} | ||
}, | ||
|
||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"end": { | ||
"character": 81, | ||
"column": 24, | ||
"line": 2 | ||
}, | ||
"message": "A11y: The value for the aria attribute 'aria-grabbed' must be exactly one of true, false, or undefined", | ||
"pos": 63, | ||
"start": { | ||
"character": 63, | ||
"column": 6, | ||
"line": 2 | ||
} | ||
} | ||
] |
9 changes: 9 additions & 0 deletions
9
test/validator/samples/a11y-aria-proptypes-global/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<span aria-hidden="yes">foo</span> | ||
<span aria-current="some wrong values">foo</span> | ||
<span aria-details>foo</span> | ||
<span aria-disabled="yes">foo</span> | ||
<span aria-haspopup="listbox tree">foo</span> | ||
<span aria-invalid="grammar spelling">foo</span> | ||
<span aria-keyshortcuts>foo</span> | ||
<span aria-label>foo</span> | ||
<span aria-roledescription>foo</span> |
145 changes: 145 additions & 0 deletions
145
test/validator/samples/a11y-aria-proptypes-global/warnings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
[ | ||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"message": "A11y: The value for the aria attribute 'aria-hidden' must be exactly one of true, false, or undefined", | ||
"start": { | ||
"line": 1, | ||
"column": 6, | ||
"character": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 23, | ||
"character": 23 | ||
}, | ||
"pos": 6 | ||
}, | ||
|
||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"end": { | ||
"character": 73, | ||
"column": 38, | ||
"line": 2 | ||
}, | ||
"message": "A11y: The value for the aria attribute 'aria-current' must be exactly one of page, step, location, date, time, true, false", | ||
"pos": 41, | ||
"start": { | ||
"character": 41, | ||
"column": 6, | ||
"line": 2 | ||
} | ||
}, | ||
|
||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"message": "A11y: The value for the aria attribute 'aria-details' must be a string that represents a DOM element ID", | ||
"start": { | ||
"line": 3, | ||
"column": 6, | ||
"character": 91 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 18, | ||
"character": 103 | ||
}, | ||
"pos": 91 | ||
}, | ||
|
||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"end": { | ||
"character": 140, | ||
"column": 25, | ||
"line": 4 | ||
}, | ||
"message": "A11y: The value for the aria attribute 'aria-disabled' must be exactly one of true or false", | ||
"pos": 121, | ||
"start": { | ||
"character": 121, | ||
"column": 6, | ||
"line": 4 | ||
} | ||
}, | ||
|
||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"end": { | ||
"character": 186, | ||
"column": 34, | ||
"line": 5 | ||
}, | ||
"message": "A11y: The value for the aria attribute 'aria-haspopup' must be exactly one of false, true, menu, listbox, tree, grid, dialog", | ||
"pos": 158, | ||
"start": { | ||
"character": 158, | ||
"column": 6, | ||
"line": 5 | ||
} | ||
}, | ||
|
||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"end": { | ||
"character": 235, | ||
"column": 37, | ||
"line": 6 | ||
}, | ||
"message": "A11y: The value for the aria attribute 'aria-invalid' must be exactly one of grammar, false, spelling, true", | ||
"pos": 204, | ||
"start": { | ||
"character": 204, | ||
"column": 6, | ||
"line": 6 | ||
} | ||
}, | ||
|
||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"end": { | ||
"character": 270, | ||
"column": 23, | ||
"line": 7 | ||
}, | ||
"message": "A11y: The value for the aria attribute 'aria-keyshortcuts' must be of type string", | ||
"pos": 253, | ||
"start": { | ||
"character": 253, | ||
"column": 6, | ||
"line": 7 | ||
} | ||
}, | ||
|
||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"end": { | ||
"character": 298, | ||
"column": 16, | ||
"line": 8 | ||
}, | ||
"message": "A11y: The value for the aria attribute 'aria-label' must be of type string", | ||
"pos": 288, | ||
"start": { | ||
"character": 288, | ||
"column": 6, | ||
"line": 8 | ||
} | ||
}, | ||
|
||
{ | ||
"code": "a11y-invalid-aria-attribute-value", | ||
"end": { | ||
"character": 336, | ||
"column": 26, | ||
"line": 9 | ||
}, | ||
"message": "A11y: The value for the aria attribute 'aria-roledescription' must be of type string", | ||
"pos": 316, | ||
"start": { | ||
"character": 316, | ||
"column": 6, | ||
"line": 9 | ||
} | ||
} | ||
] |
4 changes: 4 additions & 0 deletions
4
test/validator/samples/a11y-aria-proptypes-live-region/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span aria-atomic="yes">foo</span> | ||
<span aria-busy="yes">foo</span> | ||
<span aria-live="assertive polite">foo</span> | ||
<span aria-relevant="additions removals badvalue">foo</span> |
Oops, something went wrong.