Skip to content

ReadOnly JSDoc Tag Not Enforced in JSON Serialization #281

@RueDeRennes

Description

@RueDeRennes

The items property (which is a property in my WebComponent class) is annotated with the @readonly JSDoc tag but is still serialized without the readonly modifier afterwards in the JSON file. I’m using the --format json2 flag.
Is there any other way to make the read-only modifier available in the JSON file?

// ......

/**
 * Gets or sets the `items` property.
 *
 * @public
 * @readonly <- it should be readonly but is missing in the generated json file.
 */
public get items(): Array<HTMLElement> {
    return this._slot?.assignedElements() as Array<HTMLElement> ?? [];
}

// ......

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions