Skip to content

ESlint plugin: The TSDoc tag "@notExported" is not recognized #298

Closed

Description

I have installed TypeDoc and its plugin typedoc-plugin-not-exported that adds a new tag @notExported.
Running ESlint with eslint-plugin-tsdoc rightly complains that @notExported tag is not defined:
tsdoc-undefined-tag: The TSDoc tag "@notExported" is not defined in this configuration (tsdoc/syntax)
Is there any mechanism to make the eslint-plugin-tsdoc ignore this or generally a set of tags?
Thanks!
mario

Activity

  1. AlexRogalskiy commented on Nov 15, 2021

    @AlexRogalskiy

    You should add tsdoc.json file to the directory that contains tsconfig.json file.
    Inside tsdoc.json file you should add the following json document with corresponding tag name @notExported:

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

    more information can be found at

    https://api-extractor.com/pages/configs/tsdoc_json/

  2. crystalfp commented on Nov 18, 2021

    @crystalfp
    Author

    Yes, this solved the problem of not recognized tags, but now eslint-plugin-tsdoc complains that tsdoc-unsupported-tag: The TSDoc tag "@param" is not supported by this tool (tsdoc/syntax) at ... idem for tsdoc-unsupported-tag: The TSDoc tag "@returns" is not supported by this tool (tsdoc/syntax). But if I add @returns to tsdoc.json it complains that the tag is already defined.
    The only difference in eslint.yaml is the absence of the sourceType: "module" option because this is a legacy project.
    So really don't know how to use effectively this plugin.
    Thanks for looking!
    mario

  3. crystalfp commented on Nov 18, 2021

    @crystalfp
    Author

    Solved.

    You need to add "@param": true, "@returns": true to the "supportForTags" section of the configuration file tsdoc.json.

    Anyway, this sounds like a bug to me. The tsdoc file should supplement the standard behavior, not interfere.

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions