microsoft / microsoft/TypeScript
Allow '--noEmit' to override 'emitDeclarationOnly' from config.
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
Search Terms
- TS5053
- emitDeclarationOnly
Suggestion
Using "emitDeclarationOnly": true in your tsconfig.json prevents you to do typechecking only runs as running tsc --noEmit will throw the following error.
error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'.
And the CLI does not look like to have any flag to bypass the error (eg. something like --noEmitDeclarationOnly).
I don't see a reason why a noEmit cli flag would not take precedence over the emitDeclarationOnly from the tsconfig.
Use Cases
With a project with a tsconfig.json set with emitDeclarationOnly and using another compiler like babel to produce the built javascript code, you want to be able to both:
- Compile declaration files (running
tsc) - Perform typechecking as a test stage (eg. travis) (running
tsc --noEmit). Especially since you do not use TypeScript to compile (so a build could pass with typings errors).
Examples
https://github.com/mgcrea/node-influx-syslog
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
TS5053 を報告するコンパイラーオプションの検証から始め、コマンドラインの noEmit が tsconfig の emitDeclarationOnly とどのように統合されるかを追跡します。要求された優先順位を対象とするカバレッジを追加し、宣言出力と noEmit の型チェックの両方のパスを検証します。完了の条件は、tsc --noEmit が設定を受け入れ、通常の tsc の動作が維持されることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- cli, compilers
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100