isaacs / tshy

Other
894 stars 18 forks source link

Allow compilerOptions.target to flow from base tsconfig #54

Closed mpodwysocki closed 8 months ago

mpodwysocki commented 8 months ago

I am wondering why es2022 was hardcoded in the base build.json in the .tshy folder. Could that be configurable or is there a particular ES2022 set that you are using for tshy specifically?

isaacs commented 8 months ago

Hm, I don't have a good answer for this one. Maybe it should just be in the default tsconfig.json? Istr something not working when target isn't set, but tbh I don't recall what it was, or if that option was just thrown at the wall to see what sticks.

mpodwysocki commented 8 months ago

@isaacs could we make this configurable then from our standpoint to specify that in the base tsconfig?

isaacs commented 8 months ago

Hm, since it's defaulting in the recommended root tsconfig anyway, could probably just strike this line: https://github.com/isaacs/tshy/blob/main/src/tsconfig.ts#L53

For posterity if anyone comes searching and finds this issue, can you share what situation you're finding where it needs to be different?

mpodwysocki commented 8 months ago

@isaacs For example, we shipped our new Azure SDK Core JavaScript libraries which were previously targeting ES2020/ES2017. Some of our customers complained once upgrading that their TypeScript version did not support particular syntax which were in ES2022 such as this issue: https://github.com/Azure/azure-sdk-for-js/issues/28918

isaacs commented 8 months ago

Ahhh, yes, node 14. Cool, makes sense.

isaacs commented 8 months ago

Fixed by #55

isaacs commented 8 months ago

https://github.com/isaacs/tshy/commit/1b4b73a441f696b2b77fc145c537261b88516d3f