useValidAriaProps
¥Summary
-
规则生效日期:
v1.0.0¥Rule available since:
v1.0.0 -
诊断类别:
lint/a11y/useValidAriaProps¥Diagnostic Category:
lint/a11y/useValidAriaProps -
此规则为推荐规则,默认启用。
¥This rule is recommended, which means is enabled by default.
-
此规则包含 unsafe 修复程序。
¥This rule has an unsafe fix.
-
此规则的默认严重级别为 error。
¥The default severity of this rule is error.
-
来源:
¥Sources:
-
与
jsx-a11y/aria-props相同¥Same as
jsx-a11y/aria-props
-
¥How to configure
{ "linter": { "rules": { "a11y": { "useValidAriaProps": "error" } } }}¥Description
确保 ARIA 属性 aria-* 全部有效。
¥Ensures that ARIA properties aria-* are all valid.
¥Examples
¥Invalid
<input className="" aria-labell="" />code-block.jsx:1:1 lint/a11y/useValidAriaProps FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The element contains invalid ARIA attribute(s)
> 1 │ <input className="" aria-labell="" />
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │
ℹ aria-labell is not a valid ARIA attribute.
> 1 │ <input className="" aria-labell="" />
│ ^^^^^^^^^^^^^^
2 │
ℹ Unsafe fix: Remove the invalid aria-* attribute.
Check the list of all valid aria-* attributes.
1 │ <input·className=""·aria-labell=""·/>
│ ---------------
<div aria-lorem="foobar" />;code-block.jsx:1:1 lint/a11y/useValidAriaProps FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The element contains invalid ARIA attribute(s)
> 1 │ <div aria-lorem=“foobar” />;
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │
ℹ aria-lorem is not a valid ARIA attribute.
> 1 │ <div aria-lorem=“foobar” />;
│ ^^^^^^^^^^^^^^^^^^^
2 │
ℹ Unsafe fix: Remove the invalid aria-* attribute.
Check the list of all valid aria-* attributes.
1 │ <div·aria-lorem=“foobar”·/>;
│ --------------------
可访问性指南
Section titled “可访问性指南”¥Accessibility guidelines
¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号