microsoft / microsoft/TypeScript
Module value in TSConfig does not enforce ModuleResolution value
オープン
@andrewbranch がすでに取り組んでいます。
2026年7月27日 から。
Needs Investigation
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
🔎 Search Terms
moduleresolution enforce
🕗 Version & Regression Information
I tested also on typescript 5 and the behavior was the same
⏯ Playground Link
No response
💻 Code
According to docs certain module values imply and enforce certain moduleResolution values as decribed at https://www.typescriptlang.org/docs/handbook/modules/reference.html#implied-and-enforced-options
However the following tsconfig works without any issue:
{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "node16", // this should not be allowed
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"types": ["*"]
}
}
even when according to docs --module nodenext should enforce --moduleResolution nodenext
🙁 Actual behavior
the tsc compilation works with option that should fail according to docs
🙂 Expected behavior
fix the behavior or the docs
Additional information about the issue
typescript version: 6.0.3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。