noHeaderScope
¥Summary
-
规则生效日期:
v1.0.0¥Rule available since:
v1.0.0 -
¥Diagnostic Category:
lint/a11y/noHeaderScope -
此规则为推荐规则,默认启用。
¥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/scope相同¥Same as
jsx-a11y/scope
-
¥How to configure
{ "linter": { "rules": { "a11y": { "noHeaderScope": "error" } } }}¥Description
范围属性应仅用于 <th> 元素。
¥The scope prop should be used only on <th> elements.
¥Examples
¥Invalid
<div scope={scope} />code-block.jsx:1:6 lint/a11y/noHeaderScope FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Avoid using the scope attribute on elements other than th elements.
> 1 │ <div scope={scope} />
│ ^^^^^^^^^^^^^
2 │
ℹ The scope attribute is used to associate a data cell with its corresponding header cell in a data table,
so it should be placed on th elements to provide accessibility to screen readers.
ℹ Follow the links for more information,
WCAG 1.3.1
WCAG 4.1.1
ℹ Unsafe fix: Remove the scope attribute.
1 │ <div·scope={scope}·/>
│ --------------
<div scope="col" />code-block.jsx:1:6 lint/a11y/noHeaderScope FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Avoid using the scope attribute on elements other than th elements.
> 1 │ <div scope=“col” />
│ ^^^^^^^^^^^
2 │
ℹ The scope attribute is used to associate a data cell with its corresponding header cell in a data table,
so it should be placed on th elements to provide accessibility to screen readers.
ℹ Follow the links for more information,
WCAG 1.3.1
WCAG 4.1.1
ℹ Unsafe fix: Remove the scope attribute.
1 │ <div·scope=“col”·/>
│ ------------
¥Valid
<th scope={scope}></th><th scope="col"></th>可访问性指南
Section titled “可访问性指南”¥Accessibility guidelines
¥Related links
¥Summary
-
规则生效日期:
v2.3.0¥Rule available since:
v2.3.0 -
¥Diagnostic Category:
lint/a11y/noHeaderScope -
此规则为推荐规则,默认启用。
¥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/scope相同¥Same as
jsx-a11y/scope
-
¥How to configure
{ "linter": { "rules": { "a11y": { "noHeaderScope": "error" } } }}¥Description
范围属性应仅用于 <th> 元素。
¥The scope prop should be used only on <th> elements.
¥Examples
¥Invalid
<div scope="col"></div>code-block.html:1:6 lint/a11y/noHeaderScope FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Avoid using the scope attribute on elements other than th elements.
> 1 │ <div scope=“col”></div>
│ ^^^^^^^^^^^
2 │
ℹ The scope attribute is used to associate a data cell with its corresponding header cell in a data table,
so it should be placed on th elements to provide accessibility to screen readers.
ℹ Follow the links for more information,
WCAG 1.3.1
WCAG 4.1.1
ℹ Unsafe fix: Remove the scope attribute.
1 │ <div·scope=“col”></div>
│ -----------
<div scope></div>code-block.html:1:6 lint/a11y/noHeaderScope FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Avoid using the scope attribute on elements other than th elements.
> 1 │ <div scope></div>
│ ^^^^^
2 │
ℹ The scope attribute is used to associate a data cell with its corresponding header cell in a data table,
so it should be placed on th elements to provide accessibility to screen readers.
ℹ Follow the links for more information,
WCAG 1.3.1
WCAG 4.1.1
ℹ Unsafe fix: Remove the scope attribute.
1 │ <div·scope></div>
│ -----
¥Valid
<th scope="col"></th><th scope></th>可访问性指南
Section titled “可访问性指南”¥Accessibility guidelines
¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号