jsii icon indicating copy to clipboard operation
jsii copied to clipboard

Update tsconfig.json to the latest standards

Open rehanvdm opened this issue 4 months ago • 4 comments

Describe the feature

The generated tsconfig is using which is outdated in 2024.

"module": "CommonJS",
"target": "ES2020",
"lib": [
      "es2020"
    ],

Use Case

Stay current and up to date with the TS standards.

Proposed Solution

Use the new and latest versions:

"module": "ESNext",
"target": "ESNext",
"lib": [
      "ESNext"
    ],

Other Information

This is one of the reason why I am ejecting from projen that has tooling around JSII. My code uses the paths inside tsconfig.json and it needs to be on the newer tsconfig values for the web-based project that uses Vite to work. This forces me to create two versions of tsconfig but then I have endless problems with paths and eslint. So I decided to just publish my package https://github.com/rehanvdm/serverless-website-analytics in TS now and not any other languages.

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

CDK version used

Environment details (OS name and version, etc.)

rehanvdm avatar Feb 07 '24 09:02 rehanvdm

We can definitely talk about target and lib for the 5.4 release.

Regarding module, I'm not sure how ESM will affect the way jsii works at the moment.

mrgrain avatar Feb 14 '24 23:02 mrgrain

Also, please support disabling the generated tsconfig.json and don't write the .d.ts and .js to the src directory. That is super annoying.

sam-goodwin avatar Feb 22 '24 00:02 sam-goodwin

@sam-goodwin https://github.com/aws/jsii/issues/2071 I think this covers your request.

Otherwise please open a new issue for other request to config defaults.

mrgrain avatar Feb 22 '24 09:02 mrgrain

@rehanvdm FYI we are actively looking at #2071 at the moment, which will include a mode to remove all safe-guards. Later on we might use community feedback/experience to update the defaults. Hope that makes sense.

mrgrain avatar Apr 03 '24 15:04 mrgrain

Mostly closing this in favor of user-provided tsconfig https://github.com/aws/jsii/issues/2071

Documentation: https://aws.github.io/jsii/user-guides/lib-author/configuration/#typescript-configuration

But we still might change some defaults in future versions. New tracking issue: https://github.com/aws/jsii-compiler/issues/956

mrgrain avatar May 21 '24 13:05 mrgrain

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar May 21 '24 13:05 github-actions[bot]