microsoft / microsoft/tsdoc

How to ignore arguments to non-standard tags?

Open
#337 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5k
Forks
162
Avg merge
17h 24m
Merged PRs (30d)
8

Description

I'm using tsdoc and its eslint plugin with great satisfaction.
Now, to document *.vue files (compose API + script setup + typescript + vite), I started using
vue-docgen-cli (I had problems installing vue-styleguidist).
This tool, to document emits, uses a non standard tag @arg with a complex argument. Here is an example:

const emit = defineEmits([
  /**
   * Changed when the dialog visibility changes
   * @arg {boolean} visibility - Dialog is visible
   */
  "update:modelValue"
]);

Rightly eslint complains about the braces:

tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid
    confusion with a TSDoc inline tag

Tsdoc.json is (simplified):

{
  "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
     "tagDefinitions": [
        {
            "tagName": "@arg",
            "syntaxKind": "block"
        }
    ],
    "supportForTags": {
        "@arg": true
    }
}

Changing braces or escaping them makes the argument not recognized by vue-docgen. Is there a way to make tsdoc ignore or not check a block tag? Or the only way is to complain with vue-docgen developers?
Thanks for enlighten me!
mario

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported tsdoc.json tagDefinitions and supportForTags settings, then trace the diagnostics tsdoc-malformed-inline-tag and tsdoc-escape-right-brace for the @arg example. Done means determining whether TSDoc can accept or ignore this block-tag argument syntax without breaking vue-docgen, or documenting that the compatibility change belongs in vue-docgen.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.