Skip to content

Using a {@link toProperty} inside JSDoc leads to a crash #336

@wkillerud

Description

@wkillerud

In JSDoc I sometimes link to other properties if they're related. It's particularly helpful if something gets deprecated.

I'm not sure how wide-spread the support is, but in VSCode syntax like this shows as a clickable link when hovering over the readOnly property, and clicking it navigates to the readonly property.

class MyElement extends HTMLElement {
  /** 
   * @deprecated Use the native {@link readonly} attribute instead.
   */
  readOnly = false;

  readonly = false;
}

Unfortunately cem analyze ends up trying to serialize a circular JSON structure if I include a link like that.

Checklist

  • Did you run the analyzer with the --dev flag to get more information?
  • Did you create a minimal reproduction in the playground? (set up a small repository as well)

Completing the items above will greatly improve triaging time of your issue.

Expected behavior

In an ideal world the manifest would include enough information to know that there's a link around the word readonly and what it points to.

Perhaps more realistic is to get the text content of the link and end up with the same result as if the @link wasn't there ("Use the native readonly attribute instead.")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions