tsdoc icon indicating copy to clipboard operation
tsdoc copied to clipboard

Support for defining custom tag syntax

Open oliveryasuna opened this issue 2 years ago • 1 comments

Example:

I want to use supported JSDoc tags with @custom-elements-manifest/analyzer:

/**
 * @prop {string} dir - The directionality of the element.
 * @prop {string} lang - The language of the element.
 */

Problem:

There is no way to define custom tags that support this format.

// tsdoc.json
{
  "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
  "extends": ["@microsoft/api-extractor/extends/tsdoc-base.json"],
  "tagDefinitions": [
    {
      "tagName": "@prop",
      "syntaxKind": "modifier",
      "allowMultiple": true
    }
  ],
  "supportForTags": {
    "@prop": true
  }
}

ESLint will not pass.

Proposal:

Support custom tag syntax, perhaps through regex. Further, it would be nice if you could omit specifying the syntax kind, such that the parser would allow the content following the tag to be whatever.

oliveryasuna avatar Aug 07 '23 18:08 oliveryasuna

Is this what "noStandardTags": true, is for? I thought it was mean to allow you to disable the default behavior in case you want to override it yourself.

braebo avatar Oct 08 '23 16:10 braebo