mirror of https://github.com/sveltejs/svelte
a11y: Add role-has-required-aria-props rule (#5852)
* Check required props for ARIA roles * Test required ARIA props check * Properly indent with tabs in test * swtich to use aria-query * fix validation test * update docs Co-authored-by: tanhauhau <lhtan93@gmail.com>pull/7628/head
parent
c01dc62314
commit
1d19aebe38
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,9 @@
|
||||
<div role="heading"></div>
|
||||
<span role="checkbox"></span>
|
||||
<div role="meter"></div>
|
||||
<div role="scrollbar"></div>
|
||||
|
||||
<div role="heading" aria-level="1"></div>
|
||||
<span role="checkbox" aria-checked="false"></span>
|
||||
<div role="meter" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
<div role="scrollbar" aria-controls="panel" aria-valuenow="50"></div>
|
@ -0,0 +1,62 @@
|
||||
[
|
||||
{
|
||||
"code": "a11y-role-has-required-aria-props",
|
||||
"message": "A11y: Elements with the ARIA role \"heading\" must have the following attributes defined: \"aria-level\"",
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5,
|
||||
"character": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19,
|
||||
"character": 19
|
||||
},
|
||||
"pos": 5
|
||||
},
|
||||
{
|
||||
"code": "a11y-role-has-required-aria-props",
|
||||
"message": "A11y: Elements with the ARIA role \"checkbox\" must have the following attributes defined: \"aria-checked\"",
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6,
|
||||
"character": 33
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 21,
|
||||
"character": 48
|
||||
},
|
||||
"pos": 33
|
||||
},
|
||||
{
|
||||
"code": "a11y-role-has-required-aria-props",
|
||||
"message": "A11y: Elements with the ARIA role \"meter\" must have the following attributes defined: \"aria-valuenow\"",
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 5,
|
||||
"character": 62
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 17,
|
||||
"character": 74
|
||||
},
|
||||
"pos": 62
|
||||
},
|
||||
{
|
||||
"code": "a11y-role-has-required-aria-props",
|
||||
"message": "A11y: Elements with the ARIA role \"scrollbar\" must have the following attributes defined: \"aria-controls\", \"aria-valuenow\"",
|
||||
"start": {
|
||||
"character": 87,
|
||||
"column": 5,
|
||||
"line": 4
|
||||
},
|
||||
"end": {
|
||||
"character": 103,
|
||||
"column": 21,
|
||||
"line": 4
|
||||
},
|
||||
"pos": 87
|
||||
}
|
||||
]
|
Loading…
Reference in new issue