microsoft / microsoft/TypeScript

Support for custom Automatic Type Acquisition scopes.

オープン
#23,952 コメント 5 件 リアクション 4 件 担当者 0 名 GitHub で見る

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

Awaiting More Feedback Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

Search Terms

Automatic type acquisition scopes, custom type acquisition, acquire types from custom scope

Suggestion

The ability to specify in .tsconfig and/or IDE settings additional scopes to search beyond @types for type acquisition.

Use Cases

Private repositories with large amounts of JavaScript code and a small number of TypeScript developers who wish to produce accurate typings, and a high barrier to entry to modifying/adding declaration files to the JavaScript projects. This mirrors the public ecosystem with say, react and @types/react.

Examples

A new string array parameter of scopes to search for:

{
  "typeAcquisition": {
    "searchScopes": [
      "@companyname-types",
      "@types"
    ]
  }
}

This would also allow overriding the @types scope. The first scope with a matching declaration should win.

Checklist

My suggestion meets these guidelines:
[X] This wouldn't be a breaking change in existing TypeScript / JavaScript code
[X] This wouldn't change the runtime behavior of existing JavaScript code
[X] This could be implemented without emitting different JS based on the types of the expressions
[X] This isn't a runtime feature (e.g. new expression-level syntax)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、自動型取得の実装と tsconfig における typeAcquisition の処理を特定し、宣言パッケージのスコープが現在どのように解決されているかを追跡します。順序と @types のオーバーライドを含む searchScopes の設定動作を定義し、最初に一致する宣言スコープが選択されることを示すテストカバレッジを追加します。

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

評価

技術スタック
javascript, typescript
領域
tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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