[feature request]: Allow aria-label to suppress template-accessibility-elements-content violation

オープン
#993 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
angular, typescript

調査の方向性

まず、template-accessibility-elements-content ルールの実装とテストを見つけ、次に aria-label を使用した報告されたボタンの例を再現します。aria-label をデフォルトで受け入れるべきか、それともルールオプションを通じて受け入れるべきかを判断し、その例で違反が報告されなくなるように、関連する動作とテストを更新します。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

I'm facing an issue when I don't want to set explicit text content for a button element but I want to use aria-label for assistive technologies instead. In my current situation, I have a directive that adds icons to the button but without text.

Would it be possible for template-accessibility-elements-content to consider aria-label to be an acceptable alternative (either by default or as a rule option)?

Context and configuration

Please share:

  • Which rule is causing the problem
    template-accessibility-elements-content
  • What's the content of your tsconfig.json
{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "importHelpers": true,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "target": "ES2015",
    "module": "ESNext",
    "typeRoots": ["node_modules/@types"],
    "lib": ["ES2018", "DOM"]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true,
    "enableIvy": true
  }
}
  • What's the content of ~/.codelyzer.js (if applicable)
    I do not have it.

Expected behavior

<button class="btn-close" aria-label="close></button> should NOT produce an error.

Additional context

I believe a similar question about "aria-label" support might be raised to all others template-accessibility-* rules.

主要言語
TypeScript
スター
2.5k
フォーク
232
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mgechev/codelyzer のほかの issue

mgechev/codelyzer の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。