useValidAriaValues
诊断类别:lint/a11y/useValidAriaValues
¥Diagnostic Category: lint/a11y/useValidAriaValues
自从:v1.0.0
¥Since: v1.0.0
来源:
¥Sources:
-
与以下相同:
jsx-a11y/aria-proptypes
¥Same as:
jsx-a11y/aria-proptypes
强制正确使用 和 。
¥Enforce that ARIA state and property values are valid.
¥Examples
¥Invalid
code-block.jsx:1:23 lint/a11y/useValidAriaValues ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The value of the ARIA attribute aria-checked is not correct.
> 1 │ <span role=“checkbox” aria-checked=“test”>some text</span>
│ ^^^^^^^^^^^^^^^^^^^
2 │
ℹ The only supported value for the aria-checked property one of the following:
- true
- false
- mixed
code-block.jsx:1:7 lint/a11y/useValidAriaValues ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The value of the ARIA attribute aria-labelledby is not correct.
> 1 │ <span aria-labelledby="">some text</span>
│ ^^^^^^^^^^^^^^^^^^
2 │
ℹ The only supported value is a space-separated list of HTML identifiers.
code-block.jsx:1:7 lint/a11y/useValidAriaValues ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The value of the ARIA attribute aria-valuemax is not correct.
> 1 │ <span aria-valuemax=“hey”>some text</span>
│ ^^^^^^^^^^^^^^^^^^^
2 │
ℹ The only supported value is number.
code-block.jsx:1:7 lint/a11y/useValidAriaValues ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The value of the ARIA attribute aria-orientation is not correct.
> 1 │ <span aria-orientation=“hey”>some text</span>
│ ^^^^^^^^^^^^^^^^^^^^^^
2 │
ℹ The only supported value for the aria-orientation property is one of the following:
- vertical
- undefined
- horizontal
¥Valid
可访问性指南
Section titled 可访问性指南¥Accessibility guidelines
¥Resources
¥Related links