microsoft / microsoft/TypeScript

feature request: expose `tsconfig.json` types in TypeScript files

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

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

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

説明

🔍 Search Terms

expose tsconfig.json types to developers

✅ Viability Checklist
⭐ Suggestion

It'd be nice if TypeScript developers could enforce that an object is consistent with tsconfig.json.

📃 Motivating Example

If you're creating a tool that initializes a project that uses TypeScript, you can ensure the tsconfig.json you're composing in your source code is valid.

const tsConfig: TSConfig = {
  "compilerOptions": {
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "module": "NodeNext"
  }
};

fs.writeFileSync(
  path.join(root, "tsconfig.json"),
  JSON.stringify(tsConfig, null, 2)
);
💻 Use Cases
  1. What do you want to use this for?

I'm building a tool that initializes a TypeScript project with other dependencies.

It'd be kind of nice if I could be 100% certain the tsconfig.json I'm composing in my source code is valid.

  fs.writeFileSync(
    path.join(root, "tsconfig.json"),
    JSON.stringify(
      {
        compilerOptions: {
          target: "ESNext",
          module: "CommonJS",
          jsx: "react-jsx",
        },
        include: ["src"],
        exclude: ["node_modules"],
      },
      null,
      2
    )
  );
  1. What shortcomings exist with current approaches?

In .ts source code, TypeScript doesn't verify if a tsconfig.json file being written to disk is valid or not.

  1. What workarounds are you using in the meantime?

I'm copying over an existing tsconfig.json file from a template/ subdirectory.

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

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

はじめの一歩

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

調査の方向性

issue にある tsconfig.json の例から始め、TypeScript が現在どのようにコンパイラオプションを表現し、検証しているかを確認してください。リポジトリのファイル、テスト、エントリポイントは指定されていないため、まず実装場所と範囲を調査する必要があります。完了とは、TypeScript のソースコードで示された設定の形を検証でき、出力される JavaScript を変更しないことです。

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

評価

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

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

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