Skip to content

Respect package.json "type" and module-format-specific file extensions in more module modes - #57896

Merged
Andrew Branch (andrewbranch) merged 16 commits into
microsoft:mainfrom
andrewbranch:always-set-implied-node-format
Apr 12, 2024
Merged

Respect package.json "type" and module-format-specific file extensions in more module modes#57896
Andrew Branch (andrewbranch) merged 16 commits into
microsoft:mainfrom
andrewbranch:always-set-implied-node-format

Conversation

@andrewbranch

@andrewbranchAndrew Branch (andrewbranch) commented Mar 21, 2024

Copy link
Copy Markdown
Member

Fixes#54752
Fixes#50647
Closes#54788
Related #55221
Prerequisite for #54102

Suggest reviewing individual commits:

  • 96bffce: source changes
  • 09330b8: tests showing new behavior
  • c89137d: noise due to always looking up package.json
  • 11e5727: noise due to the same, plus impliedNodeFormat always existing in buildinfo
  • f9f46fd: less noisy changes to existing test behavior, worth reviewing

This PR allows us to use module-format-specific file extensions and package.json "type" fields in all module modes—not just in node16/nodenext as today—but the way we use them can vary by module/moduleResolution mode. This has two noticeable effects:

  1. Emit respects file extension / package.json "type" more often.

    • When module is es2015esnext, we will now treat .cts/.cjs files, as well as .ts/.js files when the nearest package.json has "type": "commonjs", as CommonJS and emit CommonJS outputs accordingly. Note that unlike in --module nodenext, a lack of package.json "type" does not cause .ts/.js files to be treated as CommonJS. We only override the default behavior of the module setting when "type" is explicitly set to "commonjs", or when the file extension is .cts/.cjs.
    • When module is commonjs, we will now treat .mts/.mjs files, as well as .ts/.js files when the nearest package.json has "type": "module", as ESM and output ESM outputs accordingly.
    • When module is preserve, ESM import/export declarations are now forbidden in .cts/.cjs files, as well as in .ts/.js files when the nearest package.json has "type": "commonjs". We want to ensure that --module preserve means the module syntax you write gets emitted without significant transformation, but we also want to prevent ESM syntax from being used in unambiguously CommonJS files, so this situation acts much like verbatimModuleSyntax is enabled.
  2. Unambiguously ESM-mode declaration files do not get synthesized default exports

    • This is ESM-only packages come with synthesized default in moduleResolution: bundler #54752. Now that we always collect information about the package.json "type" and file extension, we gain the ability to notice when a declaration file, likely in a node_modules dependency, must represent an ESM JavaScript file, which changes how a default import targeting that file works. Previously, under all module modes except node16/nodenext, this was allowed:

      // @Filename: node_modules/esm-dep/foo.d.mtsexportdeclareconstx: any;// @Filename: index.tsimportesmfrom"esm-dep/foo.mjs";esm.x;

      Since foo.d.mts has an unambiguously-ESM file extension, we should not allow a default import from a module that doesn’t declare a default export. However, it was allowed because we believed that foo.d.mts might actually represent a CommonJS module with a module.exports.x property, in which case a default import should be allowed and would link to the module.exports object. With this PR, when a declaration file has an ESM file extension or exists in a "type": "module" context, we use that to prevent us from letting a default import happen where it shouldn’t.

This work also unlocks a fix for #54102. Webpack and esbuild use module-format-specific file extensions and package.json "type" to vary their ESM/CJS interop rules, so if we want to provide correct types for projects using those bundlers, we will need to be able to leverage that module format info under --module esnext or --module preserve.

There is one test failing that represents an pre-existing bug that was not exposed until now because the test did not previously look up package.json files, and a particular sequence of edits causes a failure in combination with that. It has been isolated to a failure that doesn’t rely on this PR’s changes in #57757 so it can be investigated separately.

@typescript-bot

Copy link
Copy Markdown
Contributor

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure Daniel Rosenwasser (@DanielRosenwasser) and Ryan Cavanaugh (@RyanCavanaugh) are aware of the changes, just as a heads up.

@andrewbranchAndrew Branch (andrewbranch) changed the title Always set implied node formatRespect package.json "type" and module-format-specific file extensions in more module modesMar 21, 2024
@andrewbranch

Copy link
Copy Markdown
MemberAuthor

@typescript-bot

TypeScript Bot (typescript-bot) commented Mar 21, 2024

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

CommandStatusResults
test top400✅ Started👀 Results
perf test this✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Andrew Branch (@andrewbranch)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Angular - node (v18.15.0, x64)
Memory used295,533k (± 0.00%)296,576k (± 0.01%)+1,042k (+ 0.35%)296,555k296,596kp=0.005 n=6
Parse Time2.66s (± 0.31%)2.69s (± 0.23%)+0.03s (+ 1.25%)2.68s2.70sp=0.003 n=6
Bind Time0.82s (± 0.50%)0.83s (± 0.00%)+0.01s (+ 1.01%)0.83s0.83sp=0.007 n=6
Check Time8.19s (± 0.44%)8.27s (± 0.42%)+0.07s (+ 0.92%)8.23s8.33sp=0.012 n=6
Emit Time7.05s (± 0.27%)7.02s (± 0.25%)-0.03s (- 0.40%)7.00s7.05sp=0.028 n=6
Total Time18.72s (± 0.25%)18.81s (± 0.21%)+0.09s (+ 0.46%)18.76s18.87sp=0.019 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used193,782k (± 0.97%)193,794k (± 1.02%)~191,935k195,702kp=0.810 n=6
Parse Time1.63s (± 1.73%)1.62s (± 1.15%)~1.59s1.64sp=0.515 n=6
Bind Time0.86s (± 0.87%)0.86s (± 0.73%)~0.85s0.87sp=0.718 n=6
Check Time11.24s (± 0.95%)11.22s (± 1.02%)~11.10s11.39sp=0.573 n=6
Emit Time3.14s (± 0.62%)3.14s (± 1.13%)~3.09s3.17sp=0.683 n=6
Total Time16.87s (± 0.69%)16.85s (± 0.59%)~16.76s16.99sp=0.688 n=6
Monaco - node (v18.15.0, x64)
Memory used347,388k (± 0.00%)348,464k (± 0.01%)+1,076k (+ 0.31%)348,439k348,489kp=0.005 n=6
Parse Time2.48s (± 0.30%)2.54s (± 0.41%)+0.07s (+ 2.69%)2.53s2.56sp=0.005 n=6
Bind Time0.93s (± 0.44%)0.93s (± 0.56%)~0.92s0.93sp=0.595 n=6
Check Time7.01s (± 0.44%)7.02s (± 0.64%)~6.98s7.11sp=0.687 n=6
Emit Time4.05s (± 0.34%)4.05s (± 0.33%)~4.04s4.07sp=0.804 n=6
Total Time14.46s (± 0.23%)14.54s (± 0.33%)+0.08s (+ 0.58%)14.51s14.64sp=0.006 n=6
TFS - node (v18.15.0, x64)
Memory used302,719k (± 0.00%)303,028k (± 0.01%)+309k (+ 0.10%)302,984k303,044kp=0.005 n=6
Parse Time2.01s (± 1.12%)2.01s (± 0.44%)~2.00s2.02sp=0.934 n=6
Bind Time1.00s (± 0.55%)1.00s (± 0.51%)+0.01s (+ 0.84%)1.00s1.01sp=0.038 n=6
Check Time6.31s (± 0.36%)6.34s (± 0.38%)~6.31s6.38sp=0.072 n=6
Emit Time3.61s (± 0.51%)3.60s (± 0.45%)~3.58s3.62sp=0.325 n=6
Total Time12.93s (± 0.28%)12.96s (± 0.27%)~12.91s12.99sp=0.197 n=6
material-ui - node (v18.15.0, x64)
Memory used509,885k (± 0.01%)510,944k (± 0.01%)+1,059k (+ 0.21%)510,866k511,004kp=0.005 n=6
Parse Time3.18s (± 0.65%)3.23s (± 0.60%)+0.05s (+ 1.52%)3.20s3.25sp=0.008 n=6
Bind Time1.18s (± 1.07%)1.18s (± 1.13%)~1.16s1.20sp=1.000 n=6
Check Time20.48s (± 0.55%)20.56s (± 0.36%)~20.46s20.64sp=0.261 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time24.84s (± 0.39%)24.97s (± 0.34%)+0.13s (+ 0.51%)24.83s25.05sp=0.045 n=6
mui-docs - node (v18.15.0, x64)
Memory used1,737,535k (± 0.00%)1,743,152k (± 0.00%)+5,617k (+ 0.32%)1,743,093k1,743,194kp=0.005 n=6
Parse Time6.56s (± 0.27%)6.78s (± 0.39%)+0.22s (+ 3.33%)6.76s6.82sp=0.005 n=6
Bind Time2.35s (± 0.47%)2.35s (± 0.71%)~2.32s2.36sp=0.667 n=6
Check Time56.29s (± 0.33%)56.25s (± 0.14%)~56.16s56.36sp=0.748 n=6
Emit Time0.13s (± 0.00%)0.15s (± 3.77%)🔻+0.02s (+11.54%)0.14s0.15sp=0.002 n=6
Total Time65.33s (± 0.28%)65.53s (± 0.13%)~65.45s65.64sp=0.066 n=6
self-build-src - node (v18.15.0, x64)
Memory used2,393,473k (± 0.04%)2,394,535k (± 0.04%)~2,393,418k2,395,490kp=0.093 n=6
Parse Time5.02s (± 0.67%)5.00s (± 0.79%)~4.95s5.06sp=0.521 n=6
Bind Time1.89s (± 0.70%)1.91s (± 0.61%)+0.02s (+ 1.24%)1.90s1.93sp=0.018 n=6
Check Time33.56s (± 0.26%)33.47s (± 0.22%)~33.36s33.55sp=0.078 n=6
Emit Time2.64s (± 0.95%)2.61s (± 1.80%)~2.57s2.67sp=0.377 n=6
Total Time43.11s (± 0.20%)43.01s (± 0.24%)~42.88s43.13sp=0.128 n=6
self-compiler - node (v18.15.0, x64)
Memory used415,205k (± 0.01%)415,437k (± 0.00%)+232k (+ 0.06%)415,425k415,454kp=0.005 n=6
Parse Time3.40s (± 0.37%)3.39s (± 1.33%)~3.33s3.45sp=0.375 n=6
Bind Time1.27s (± 0.32%)1.28s (± 0.43%)+0.01s (+ 1.05%)1.28s1.29sp=0.006 n=6
Check Time18.01s (± 0.44%)18.02s (± 0.32%)~17.95s18.10sp=0.518 n=6
Emit Time1.33s (± 0.57%)1.33s (± 0.91%)~1.32s1.35sp=0.503 n=6
Total Time24.01s (± 0.31%)24.03s (± 0.31%)~23.95s24.14sp=0.630 n=6
vscode - node (v18.15.0, x64)
Memory used2,889,651k (± 0.00%)2,894,745k (± 0.00%)+5,094k (+ 0.18%)2,894,620k2,894,859kp=0.005 n=6
Parse Time12.94s (± 0.35%)13.32s (± 0.24%)+0.37s (+ 2.90%)13.27s13.36sp=0.005 n=6
Bind Time4.14s (± 1.12%)4.13s (± 0.52%)~4.10s4.16sp=0.686 n=6
Check Time71.58s (± 0.50%)71.94s (± 0.50%)~71.52s72.34sp=0.173 n=6
Emit Time19.39s (± 0.23%)20.16s (± 8.10%)~19.38s23.48sp=0.091 n=6
Total Time108.05s (± 0.32%)109.54s (± 1.68%)+1.50s (+ 1.38%)108.46s113.22sp=0.005 n=6
webpack - node (v18.15.0, x64)
Memory used408,124k (± 0.01%)408,745k (± 0.01%)+621k (+ 0.15%)408,701k408,833kp=0.005 n=6
Parse Time3.24s (± 0.30%)3.27s (± 0.84%)+0.03s (+ 0.87%)3.23s3.31sp=0.042 n=6
Bind Time1.39s (± 0.84%)1.40s (± 0.29%)~1.40s1.41sp=0.102 n=6
Check Time14.23s (± 0.22%)14.32s (± 0.32%)+0.09s (+ 0.63%)14.26s14.39sp=0.008 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time18.86s (± 0.18%)18.99s (± 0.31%)+0.13s (+ 0.69%)18.93s19.10sp=0.005 n=6
xstate - node (v18.15.0, x64)
Memory used513,045k (± 0.02%)513,859k (± 0.02%)+814k (+ 0.16%)513,754k513,961kp=0.005 n=6
Parse Time3.95s (± 0.42%)4.03s (± 0.43%)+0.07s (+ 1.81%)4.00s4.05sp=0.005 n=6
Bind Time1.86s (± 0.79%)1.85s (± 0.65%)~1.84s1.87sp=0.503 n=6
Check Time3.38s (± 0.74%)3.38s (± 0.49%)~3.36s3.40sp=0.372 n=6
Emit Time0.09s (± 6.44%)0.09s (± 4.45%)🔻+0.01s (+ 7.84%)0.09s0.10sp=0.003 n=6
Total Time9.28s (± 0.25%)9.36s (± 0.33%)+0.08s (+ 0.88%)9.31s9.39sp=0.008 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,844ms (± 1.26%)2,877ms (± 0.25%)+33ms (+ 1.17%)2,868ms2,889msp=0.005 n=6
Req 2 - geterr6,666ms (± 0.79%)6,767ms (± 0.45%)+101ms (+ 1.52%)6,737ms6,821msp=0.005 n=6
Req 3 - references387ms (± 1.12%)393ms (± 1.08%)+6ms (+ 1.51%)390ms401msp=0.045 n=6
Req 4 - navto334ms (± 0.24%)329ms (± 0.00%)-5ms (- 1.60%)329ms329msp=0.002 n=6
Req 5 - completionInfo count1,357 (± 0.00%)1,357 (± 0.00%)~1,3571,357p=1.000 n=6
Req 5 - completionInfo105ms (± 1.11%)119ms (± 2.12%)🔻+14ms (+13.15%)117ms124msp=0.005 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,494ms (± 0.86%)2,502ms (± 1.14%)~2,448ms2,529msp=0.298 n=6
Req 2 - geterr4,140ms (± 1.35%)4,132ms (± 0.28%)~4,112ms4,141msp=0.689 n=6
Req 3 - references334ms (± 0.84%)333ms (± 0.49%)~331ms334msp=0.677 n=6
Req 4 - navto294ms (± 0.51%)298ms (± 2.40%)~294ms312msp=0.210 n=6
Req 5 - completionInfo count1,519 (± 0.00%)1,519 (± 0.00%)~1,5191,519p=1.000 n=6
Req 5 - completionInfo74ms (± 2.70%)76ms (± 8.40%)~73ms89msp=0.652 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen3,095ms (± 0.65%)3,168ms (± 0.54%)+74ms (+ 2.38%)3,141ms3,186msp=0.005 n=6
Req 2 - geterr2,326ms (± 7.72%)2,393ms (± 9.01%)~1,967ms2,550msp=0.093 n=6
Req 3 - references149ms (± 1.67%)147ms (± 1.09%)~145ms150msp=0.102 n=6
Req 4 - navto554ms (± 0.24%)559ms (± 1.59%)~550ms571msp=0.513 n=6
Req 5 - completionInfo count2,079 (± 0.00%)2,079 (± 0.00%)~2,0792,079p=1.000 n=6
Req 5 - completionInfo451ms (± 1.16%)475ms (± 1.77%)🔻+23ms (+ 5.17%)467ms491msp=0.005 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time152.27ms (± 0.16%)152.20ms (± 0.15%)-0.07ms (- 0.04%)151.17ms155.62msp=0.036 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time225.27ms (± 0.15%)225.18ms (± 0.18%)-0.09ms (- 0.04%)223.85ms234.59msp=0.001 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time269.82ms (± 0.30%)269.96ms (± 0.34%)+0.14ms (+ 0.05%)262.76ms286.74msp=0.006 n=600
typescript-startup - node (v18.15.0, x64)
Execution time269.85ms (± 0.31%)270.03ms (± 0.31%)+0.18ms (+ 0.07%)262.87ms278.28msp=0.008 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Andrew Branch (@andrewbranch) Here are the results of running the top 400 repos comparing main and refs/pull/57896/merge:

Something interesting changed - please have a look.

Details

microsoft/playwright

4 of 15 projects failed to build with the old tsc and were ignored

packages/html-reporter/tsconfig.json

@jakebailey

Copy link
Copy Markdown
Member
  • When module is preserve, ESM import/export declarations are now forbidden in .cts/.cjs files, as well as in .ts/.js files when the nearest package.json has "type": "commonjs". We want to ensure that --module preserve means the module syntax you write gets emitted without significant transformation, but we also want to prevent ESM syntax from being used in unambiguously CommonJS files, so this situation acts much like verbatimModuleSyntax is enabled.

FWIW this does not match the behavior of esbuild or bun; both accept import statements with those file extensions:

$ cat index.ctsimport fs from "fs";console.log("my code is:");console.log(fs.readFileSync(__filename, "utf8"));
$ bun run index.ctsmy code is:import fs from "fs";console.log("my code is:");console.log(fs.readFileSync(__filename, "utf8"));
$ bunx esbuild --platform=node --bundle index.ctsvar __create = Object.create;var __defProp = Object.defineProperty;var __getOwnPropDesc = Object.getOwnPropertyDescriptor;var __getOwnPropNames = Object.getOwnPropertyNames;var __getProtoOf = Object.getPrototypeOf;var __hasOwnProp = Object.prototype.hasOwnProperty;var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });var __reExport = (target, module2, copyDefault, desc) => { if (module2 && typeof module2 === "object" || typeof module2 === "function") { for (let key of __getOwnPropNames(module2)) if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); } return target;};var __toESM = (module2, isNodeMode) => { return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);};// index.ctsvar import_fs = __toESM(require("fs"));console.log("my code is:");console.log(import_fs.default.readFileSync(__filename, "utf8"));

I'm not totally sure how widespread this is, though. But it does in general make me nervous about making files stricter based on type=... semantics (especially in the mode which vscode will be using for all users?)

@andrewbranch

Copy link
Copy Markdown
MemberAuthor

Jake Bailey (@jakebailey) but if you make those file extensions .cjs instead of .cts?

@jakebailey

Copy link
Copy Markdown
Member

Works the same:

$ bun run index.cjsmy code is:import fs from "fs";console.log("my code is:");console.log(fs.readFileSync(__filename, "utf8"));
$ bunx esbuild --platform=node --bundle index.cjsvar __create = Object.create;var __defProp = Object.defineProperty;var __getOwnPropDesc = Object.getOwnPropertyDescriptor;var __getOwnPropNames = Object.getOwnPropertyNames;var __getProtoOf = Object.getPrototypeOf;var __hasOwnProp = Object.prototype.hasOwnProperty;var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });var __reExport = (target, module2, copyDefault, desc) => { if (module2 && typeof module2 === "object" || typeof module2 === "function") { for (let key of __getOwnPropNames(module2)) if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); } return target;};var __toESM = (module2, isNodeMode) => { return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);};// index.cjsvar import_fs = __toESM(require("fs"));console.log("my code is:");console.log(import_fs.default.readFileSync(__filename, "utf8"));

@andrewbranch

Copy link
Copy Markdown
MemberAuthor

I think it’s ok for us to be more restrictive and opinionated than any single bundler or runtime here. It’s in Bun’s best interest to make plausibly interpretable input code execute without errors. tsc outputs can and will often be used across a wide variety of compilers and runtimes, so we have an interest in making sure they’re not footguns. And I don’t see any real reason why someone would want to emit an import into a .cjs file.

@jakebailey

Copy link
Copy Markdown
Member

Sure, the CJS thing isn't so bad; from my reading this PR doesn't prevent people from using the icky "set module=esnext to emit ESM" trick, so I don't think there are any extra cases I'm concerned about off the top of my head.

case ModuleKind.System:
return transformSystemModule;
default:
return transformModule;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just make this switch exhaustive? This last case is really only for ModuleKind.None, right?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMD/UMD too

Comment threadsrc/compiler/utilities.ts Outdated

@jakebaileyJake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #57931 I think this is all good.

@andrewbranchAndrew Branch (andrewbranch) added the Breaking Change Would introduce errors in existing code label Mar 26, 2024
Comment threadsrc/compiler/utilities.ts Outdated
Comment threadsrc/compiler/checker.ts Outdated
Comment threadsrc/compiler/checker.ts Outdated
Comment threadsrc/compiler/moduleSpecifiers.ts Outdated
Comment threadsrc/compiler/program.ts
Comment threadsrc/compiler/program.ts
Comment threadsrc/services/codefixes/importFixes.ts Outdated
@andrewbranch
Andrew Branch (andrewbranch) merged commit 585a9af into microsoft:mainApr 12, 2024
@andrewbranch
Andrew Branch (andrewbranch) deleted the always-set-implied-node-format branch April 12, 2024 19:47
Andrew Branch (andrewbranch) added a commit that referenced this pull request Jun 12, 2024
Andrew Branch (andrewbranch) added a commit that referenced this pull request Jun 13, 2024
…e-5.5 (#58848)
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
Co-authored-by: Andrew Branch <andrew@wheream.io>
Andrew Branch (andrewbranch) added a commit to andrewbranch/TypeScript that referenced this pull request Jun 13, 2024
… extensions in more `module` modes (microsoft#57896)"
This reverts commit 585a9af.
Andrew Branch (andrewbranch) added a commit to andrewbranch/TypeScript that referenced this pull request Jun 13, 2024
… extensions in more `module` modes (microsoft#57896)"
This reverts commit 585a9af.
Andrew Branch (andrewbranch) added a commit to andrewbranch/TypeScript that referenced this pull request Jun 13, 2024
… extensions in more `module` modes (microsoft#57896)"
This reverts commit 585a9af.
Andrew Branch (andrewbranch) added a commit that referenced this pull request Jun 13, 2024
Andrew Branch (andrewbranch) added a commit to andrewbranch/TypeScript that referenced this pull request Jun 17, 2024
…fic file extensions in more `module` modes (microsoft#57896)""
This reverts commit d3c8f08.
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamBreaking ChangeWould introduce errors in existing codeFor Milestone BugPRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESM-only packages come with synthesized default in moduleResolution: bundler Typescript [4.8.2] is adding invalid javascript for *.cjs files

6 participants

@andrewbranch@typescript-bot@jakebailey@weswigham@sheetalkamat@sandersn