tsconfig / bases

Hosts TSConfigs to extend in a TypeScript app, tuned to a particular runtime environment
MIT License
6.34k stars 237 forks source link

node 22 has Iterator helpers but TS with the node 22 config is throwing errors #282

Open acommodari opened 1 week ago

acommodari commented 1 week ago

As the title says it seems with the current target/lib I cant use iterator helpers even though TS 5.6 and node 22 supports them

SoulKa commented 6 days ago

It also seems that the @tsconfig/node22 using es2023 as lib does not include Array.fromAsync() which is actually officially supported since node 22: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fromAsync#browser_compatibility.

I believe that "ESNext.Array" should be included in lib

orta commented 6 days ago

no tsconfig bases should use esnext libs, they need to wait until it's been moved into a concrete year .d.ts

I'm not up-to-date on the shipped dts files though I'm afraid

SoulKa commented 6 days ago

I'm confused. Shouldn't this tsconfig represent the available methods in node 22? Because node 22 has Array.fromAsync(). However, this is not in "es2023" but can be included by "ESNext.Array".

jakebailey commented 6 days ago

If anything the node types can copy the declarations so they're there ahead of time (they did this for .at). Including esnext is definitely a no-no.