microsoft / microsoft/TypeScript
HTMLCollection should be string indexable
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
According to MDN, HTMLCollection should be string indexable:
HTMLCollection also exposes its members directly as properties by both name and index. HTML IDs may contain : and . as valid characters, which would necessitate using bracket notation for property access. Currently HTMLCollections does not recognize purely numeric IDs, which would cause conflict with the array-style access, though HTML5 does permit these.
TypeScript Version: master
Code
declare const elements: HTMLCollection;
elements['myId'] // implicit any error, where it should be the same type as elements[0].
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、TypeScript の標準ライブラリ定義にある HTMLCollection の宣言を見つけ、数値プロパティアクセスと名前付きプロパティアクセスを比較します。issue のコード例を使って、文字列によるインデックスアクセスが数値によるインデックスアクセスと同じ要素型を生成することを確認します。名前付きアクセスだけで暗黙の any エラーが報告されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- html, typescript
- 領域
- web-dev
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100