You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of type definitions in DefinatelyType export CommonJS module types and a global type definition for popular libraries. I.E Jquery can be used directly from the window object but also using the require syntax.
But this causes Typescript to accept faulty code as correct. E.g using $ or jQuery directly in a commonjs module without requiring the module itself is compiled correctly, when in the first place it was a bug not to require the module.
So can there be a flag where if commonjs modules is enabled then global types are not supported, and only types exported through a module name?
The text was updated successfully, but these errors were encountered:
#4913 has been proposed as a possible solution to this, but we have a number of competing proposals around the node package typing space. (You can find some of them linked in that PR)
A lot of type definitions in DefinatelyType export CommonJS module types and a global type definition for popular libraries. I.E Jquery can be used directly from the window object but also using the require syntax.
But this causes Typescript to accept faulty code as correct. E.g using $ or jQuery directly in a commonjs module without requiring the module itself is compiled correctly, when in the first place it was a bug not to require the module.
So can there be a flag where if commonjs modules is enabled then global types are not supported, and only types exported through a module name?
The text was updated successfully, but these errors were encountered: