sindresorhus / globby

User-friendly glob matching
MIT License
2.51k stars 130 forks source link

Work around TypeScript type problem with `URL` global #206

Closed antongolub closed 2 years ago

antongolub commented 2 years ago

relates #201

https://github.com/sindresorhus/globby/pull/201#discussion_r785471096

sindresorhus commented 2 years ago

This should not be needed. URL is a valid global in Node.js.

antongolub commented 2 years ago

Correct, should not be needed. However built-in TS libdefs (4.5.4) do not reflect this fact.

image

And @types/node too. image

antongolub commented 2 years ago

I'll push a PR to TS/DefinetlyTyped, but right now I'd like to fix our CI/CD.

antongolub commented 2 years ago

Clarified for myself what's going on: it seems that if we have no explicit lib declaration in compilerOptions, TS attaches dom, es5, etc as default.

image

sindresorhus commented 2 years ago

I forgot, this is actually a long running TS issue: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34960 (I cannot believe they have still not fixed that...)

sindresorhus commented 2 years ago

https://github.com/sindresorhus/globby/releases/tag/v12.2.0