angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Update default `tsconfig.json` options

Open dgp1130 opened this issue 1 year ago • 3 comments

Command

new, update

Description

It's been a while since we've looked at recent TypeScript configuration changes and refreshed the default Angular setup. We should review recent additions and changes to look for anything we want to enable in ng new as well as through ng update for existing apps.

Two options in particular which stand out:

  • moduleResolution: 'bundler' - This seems appropriate given our esbuild / Webpack usage.
  • allowSyntheticDefaultImports: true - I believe this is recommended by the TypeScript team.
  • esModuleInterop: true - This is highly recommended for our esbuild setup and maybe we should just make it the default.

We don't need to be specifically limited to these three options, but those are the immediate ones to consider.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

dgp1130 avatar Nov 09 '23 01:11 dgp1130

In version 17, for new apps we now enable esModuleInterop, which also enables allowSyntheticDefaultImports.

alan-agius4 avatar Nov 09 '23 06:11 alan-agius4

Also, should downlevelIteration be set to false by default in year of 2023? Do we really need to to support <ES2015?

zip-fa avatar Nov 09 '23 08:11 zip-fa

Also, should downlevelIteration be set to false by default in year of 2023? Do we really need to to support <ES2015?

Starting with Angular CLI 17.0.1 in new generated workspaces downlevelIteration is no longer set (see https://github.com/angular/angular-cli/commit/f7f62c9d6988e6801981592f56137cd02bfe2316).

sonallux avatar Nov 18 '23 10:11 sonallux

Closing as this has been completed as part of version 18 where we added moduleResolution: 'bundler'

alan-agius4 avatar Apr 24 '24 10:04 alan-agius4

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.