Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
crystalfp opened this issue Aug 13, 2021 · 3 comments
Closed

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

crystalfp opened this issue Aug 13, 2021 · 3 comments

Comments

@crystalfp
Copy link

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

@AlexRogalskiy
Copy link

AlexRogalskiy commented Nov 15, 2021

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/

@crystalfp
Copy link
Author

crystalfp commented Nov 18, 2021

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

@crystalfp
Copy link
Author

crystalfp commented Nov 18, 2021

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants