Provide easier access to object
in JavaScript JSDoc
#34980
Labels
Breaking Change
Would introduce errors in existing code
Fixed
A PR has been merged for this issue
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
Milestone
Search Terms
Suggestion
There should be a compiler option like
strictJSDocTypes
or something to disable theobject
toany
conversion present in TypeScript’s JSDoc parser.Use Cases
I’m currently forced to use:
/** @typedef {NonNullable<Parameters<typeof Object.create>[0]>} obj */
to get a reference to TypeScript’s
object
type.Examples
Any code where I use the above.
The following code creates an object with writable, configurable and non‑enumerable properties:
All instances of
object
in the above code currently have to be replaced with theobj
type alias.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: