Where I would only have expected lib.d.ts and lib.es5.d.ts.
I noticed that peggy has @types/node@20.4.9 installed, and sure enough, adding that to another ts5 project gets all those libraries pulled in too (and allows me to call endsWith without warnings).
But removing it from peggy doesn't do anything because other things that peggy depends on also depend on @types/node, and I can't find a way to get tsc to ignore it (although I'm by no means an expert on tsconfig).
So the upshot is that although tsc is targeting es5, its not going to complain about non-es5 functions (and note that it doesn't polly fill them either).
I've confirmed that the current release of peggy has a non-pollyfilled call to string.endsWith, and apparently thats fine (I think all current browsers support both endsWith, and es6 in general). So should the target be bumped to es6?
I noticed that tsconfig has
"target": "es5"
, but at the same time, in #430 tsc doesn't complain aboutstring.endsWith()
.That surprised me, because in other projects I have, the only way to get tsc to accept
endsWith
is to settarget
toes6
or above.So I tried
npx tsc --noEmit --listFiles
, and saw (amongst lots of other output)Where I would only have expected
lib.d.ts
andlib.es5.d.ts
.I noticed that peggy has
@types/node@20.4.9
installed, and sure enough, adding that to another ts5 project gets all those libraries pulled in too (and allows me to callendsWith
without warnings).But removing it from peggy doesn't do anything because other things that peggy depends on also depend on
@types/node
, and I can't find a way to get tsc to ignore it (although I'm by no means an expert on tsconfig).So the upshot is that although tsc is targeting
es5
, its not going to complain about non-es5 functions (and note that it doesn't polly fill them either).I've confirmed that the current release of peggy has a non-pollyfilled call to string.endsWith, and apparently thats fine (I think all current browsers support both endsWith, and es6 in general). So should the target be bumped to
es6
?