Skip to content
Latchkey

tsconfig.json とは?

tsconfig.json の解説。何をするものか、そして CI/CD でなぜ重要かを含みます。

tsconfig.json は TypeScript コンパイラ (tsc) の設定ファイルです。

何であるか

コンパイラオプション (target、module、strict、paths)、含めるファイル、そして project references を設定します。tsc とエディタはこれを読んで型チェックを行い、JavaScript を出力します。

CI/CD でなぜ重要か

CI は tsc --noEmit を型チェックの gate として実行します。pathsmoduleResolution の設定ミスは、CI でのみ発生する型エラーのよくある原因です。

重要なポイント

  • tsconfig.json は tsc を設定します。
  • strictness、target、paths を設定します。
  • CI は tsc --noEmit を gate として使います。

関連ガイド