microsoft / microsoft/TypeScript
compilerOptions.plugins is not inherited through tsconfig "extends"
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
🔎 Search Terms
extends plugins, compilerOptions.plugins extends, plugins not inherited, tsconfig extends inheritance, showConfig plugins
🕗 Version & Regression Information
- This changed between versions 6.0.3 and 7.x
- Verified against e9e477458d7b975ed5e43117fb85f6bc87363a6a
⏯ Playground Link
No response
💻 Code
tsconfig.base.json:
{ "compilerOptions": { "plugins": [{ "name": "my-plugin" }] } }
tsconfig.json:
{ "extends": "./tsconfig.base.json", "compilerOptions": { "module": "nodenext" } }
Then run tsc -p . --showConfig
🙁 Actual behavior
compilerOptions.plugins is absent from the resulting config. A plugins array declared only in a base config never reaches ParsedCommandLine.Raw, it survives only if the leaf tsconfig redeclares it.
🙂 Expected behavior
plugins is inherited from the base config, as with any other compilerOptions entry the child doesn't override (6.0.3 behaviour).
Additional information about the issue
Cause
plugins is the only declared compiler option with no field on core.CompilerOptions, it's carried purely as raw JSON. So mergeCompilerOptions never brings it across, and applyExtendedConfig's raw-JSON merge only handles include/exclude/files/contentMappers/compileOnSave.
Possibly related
root-level watchOptions looks like the same issue.
Fix
I have a fix with tests ready and am happy to open a PR.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
mergeCompilerOptions と applyExtendedConfig から始め、compilerOptions.plugins がどのように ParsedCommandLine.Raw に到達するかを追ってください。tsc -p . --showConfig でケースを再現し、その後、拡張された tsconfig の plugins が再宣言なしに結果の設定に現れることを示す回帰テストを追加してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 65/100