Closed GermanJablo closed 2 months ago
In a word, correctness. It's important that the types reflect the runtime environment.
My confusion arises from the fact that full-stack frameworks execute code in both environments.
Are there any types that exist in both environments and are different?
Famously, setTimeout
Well, but you can use window.setTimeout when you're in the browser to set the correct type. Which again, is what you have to do anyway in full-stack frameworks that can run code in both environments.
And even if there were a different case or two, I personally find it more likely to run into an error starting with no-dom
and then ending up needing something from the dom
.
Personally I'm always going to use "es2022", "dom", "dom.iterable"
, but that's just my two cents, and I understand your point and if you want to leave it as it is now.
I have a version of this repository that is a single file intended to be copied and pasted rather than installed.
I don't know if you've seen it, but I invited you to participate for a couple of PRs. I'm particularly interested in this one: