microsoft / microsoft/TypeScript

Module value in TSConfig does not enforce ModuleResolution value

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

@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

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

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

はじめの一歩

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

評価

この issue はまだ評価されていません。

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

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