jsx-a11y/no-aria-hidden-on-focusable 正しさ
何を実行するか
フォーカシング可能な要素に aria-hidden="true" が設定されていないことを強制します。
なぜこれは問題か
フォーカシング可能な要素に aria-hidden="true" を設定すると、スクリーンリーダーの利用者にとって混乱や予期しない動作を引き起こす可能性があります。
例
このルールに関して 不適切な コードの例:
jsx
<div aria-hidden="true" tabIndex="0" />このルールに関して 適切な コードの例:
jsx
<div aria-hidden="true" />使い方
設定ファイルまたは CLI でこのルールを 有効化 するには、次のように使用できます:
json
{
"plugins": ["jsx-a11y"],
"rules": {
"jsx-a11y/no-aria-hidden-on-focusable": "error"
}
}bash
oxlint --deny jsx-a11y/no-aria-hidden-on-focusable --jsx-a11y-plugin