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
{{ message }}
Repository navigation
Provide easier access to object in JavaScript JSDoc #34980
Neither object nor Object have defined properties or string index
signatures, which means that they give too many errors to be useful in
Javascript. Until Typescript 3.7, both were rewritten to any, but we
found that few people used object in JSDoc, and that more and more
JSDoc authors wanted to use object with its Typescript meaning. The
rewrite Object -> any is disabled when "noImplicitAny": true,
which the compiler takes as a signal that the code is being written
with Typescript in mind.
derp! yes, I misread the code when writing that new text. getIntendedTypeFromJSDocTypeReference doesn't handle object, so I assumed that a discussion I had earlier about turning off object -> any had resulted in the change. But actually it only operates on type references, not keywords. object is a keyword, so it's handled in getTypeFromTypeNode.
I need to track down that discussion, because I think it had some analysis of actual usage.
Activity
andrewbranch commentedon Dec 6, 2019
Nathan Shively-Sanders (@sandersn) my understanding from microsoft/TypeScript-New-Handbook#36 was that
objectwas no longer rewritten toanyas of 3.7, but it doesn’t seem like that’s the case?sandersn commentedon Dec 11, 2019
derp! yes, I misread the code when writing that new text.
getIntendedTypeFromJSDocTypeReferencedoesn't handleobject, so I assumed that a discussion I had earlier about turning offobject -> anyhad resulted in the change. But actually it only operates on type references, not keywords.objectis a keyword, so it's handled ingetTypeFromTypeNode.I need to track down that discussion, because I think it had some analysis of actual usage.
sandersn commentedon Dec 11, 2019
But in summary:
objectto meananythe way we've observedObjectbeing used.