- Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
TypeScript Version: 4.0.0-dev.20200701
Search Terms: Jsdoc type alias circularly references itself
I'm trying to describe json type in .js
file using jsdoc.
// Type alias 'JsonArray' circularly references itself. /** @typedef {ReadonlyArray<Json>} JsonArray */ /** @typedef {{ readonly [key: string]: Json }} JsonRecord */ // Type alias 'Json' circularly references itself. /** @typedef {boolean | number | string | null | JsonRecord | JsonArray | readonly []} Json */
It shows me some errors that JsonArray and Json types circularly reference to itself.
Tried the same in .ts
file. There got no errors.
type JsonArray = ReadonlyArray<Json> type JsonRecord = { readonly [key: string]: Json } // OK type Json = boolean | number | string | null | JsonRecord | JsonArray | readonly []
Expected behaviour: Json types in .js
and .ts
files should work identical.
dhermes
Metadata
Metadata
Assignees
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.