inversify / InversifyJS

A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
http://inversify.io/
MIT License
11.33k stars 718 forks source link

Constrain node typings to node-only code and dom typings to browser-only code #1375

Open jakehamtexas opened 3 years ago

jakehamtexas commented 3 years ago

Context

See for some context: https://github.com/inversify/InversifyJS/pull/1374

Because the dom library is included in the root tsconfig.json, there are typings in server-side only node which should not exist. This can make it hard to debug issues where the browser typings are masking that an object is possibly undefined.

Recommendation

Split the root tsconfig.json into a server and browser version and propagate the change downstream to the project, or otherwise confine node typings to server-only library code, and dom typings to browser-only library code.

tonyhallett commented 3 years ago

Agreed https://github.com/inversify/InversifyJS/pull/1311#issuecomment-907092941