web-component-analyzer icon indicating copy to clipboard operation
web-component-analyzer copied to clipboard

ReadOnly JSDoc Tag Not Enforced in JSON Serialization

Open RueDeRennes opened this issue 2 years ago • 0 comments

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> ?? [];
}

// ......

RueDeRennes avatar Jul 24 '24 18:07 RueDeRennes