TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Module resolution: the `moduleResolution` compiler option seems set to be `bundler` when the `module` compiler option is set to `ES6`, `ES2015`, `ES2020`, `ES2022`, or `ESNext`.

Open tcaesvk opened this issue 10 months ago • 0 comments

Acknowledgement

  • [x] I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

Comment

The moduleResolution compiler option allows the following values: ~node10~, ~classic~, ~node16~, ~nodenext~, and bundler; its default value is classic when the module compiler option is set to any of CommonJS, Node16, NodeNext, or Preserve as documented.

  • classic, the current default value, is scheduled to be deprecated in TypeScript 6.0.
  • node10 is only for backwards compatibility and it should also no longer be used.
  • node16 and nodenext requires the module compiler option to be set to Node16 or NodeNext for error TS5110.
  • bundler seems to be the only possible option by elimination when the module compiler option is set to ES6, ES2015, ES2020, ES2022, or ESNext.

In my opinion, the default value for moduleResolution compiler option needs to change to bundler when the module compiler option is set to any of ES6, ES2015, ES2020, ES2022, or ESNext.

tcaesvk avatar Mar 20 '25 03:03 tcaesvk