useValidAriaRole
诊断类别:lint/a11y/useValidAriaRole
¥Diagnostic Category: lint/a11y/useValidAriaRole
自从:v1.4.0
¥Since: v1.4.0
来源:
¥Sources:
-
与以下相同:
jsx-a11y/aria-role
¥Same as:
jsx-a11y/aria-role
具有 ARIA 角色的元素必须使用有效的非抽象 ARIA 角色。
¥Elements with ARIA roles must use a valid, non-abstract ARIA role.
¥Examples
¥Invalid
code-block.jsx:1:1 lint/a11y/useValidAriaRole FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
> 1 │ <div role=“datepicker”></div>
│ ^^^^^^^^^^^^^^^^^^^^^^^
2 │
ℹ Check WAI-ARIA for valid roles or provide options accordingly.
ℹ Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
1 │ <div·role=“datepicker”></div>
│ -----------------
code-block.jsx:1:1 lint/a11y/useValidAriaRole FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
> 1 │ <div role=“range”></div>
│ ^^^^^^^^^^^^^^^^^^
2 │
ℹ Check WAI-ARIA for valid roles or provide options accordingly.
ℹ Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
1 │ <div·role=“range”></div>
│ ------------
code-block.jsx:1:1 lint/a11y/useValidAriaRole FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
> 1 │ <div role=""></div>
│ ^^^^^^^^^^^^^
2 │
ℹ Check WAI-ARIA for valid roles or provide options accordingly.
ℹ Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
1 │ <div·role=""></div>
│ -------
code-block.jsx:1:1 lint/a11y/useValidAriaRole FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
> 1 │ <Foo role=“foo”></Foo>
│ ^^^^^^^^^^^^^^^^
2 │
ℹ Check WAI-ARIA for valid roles or provide options accordingly.
ℹ Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
1 │ <Foo·role=“foo”></Foo>
│ ----------
¥Valid
¥Options
可访问性指南
Section titled 可访问性指南¥Accessibility guidelines
¥Resources
¥Related links