Skip to content

eslint-plugin-jsdoc is ignorant about TypeDoc & TSDoc tags #3151

@boneskull

Description

@boneskull

eslint-plugin-jsdoc does some nice things, but it does not recognize the full set of tags as supported by TypeDoc (nor TSDoc, I imagine).

AFAICT the place to edit the rules for the JSDoc plugin is packages/eslint-plugin-lib/configs/style.js.

Some possible solutions:

  1. Add all of the missing tags to the rules (which incurs a maintenance burden)
  2. Disable checking of tags entirely; TypeDoc will warn if it encounters an unknown tag (and we can cause warnings to break in CI if we aren't already)
  3. Remove eslint-plugin-jsdoc since we're mostly just disabling its rules anyhow

My personal preference is for either 2 or 3.

If we remove it, then I think we should add prettier-plugin-jsdoc which I can vouch for. They would probably fight like bettas if we tried to use both at once, though.

Note

Tangentially, the appearance of JSDoc tags in .ts sources will necessarily differ from those in .js sources, because types will be omitted from the former. I don't know how well eslint-plugin-jsdoc understands this or if it's currently just ignoring .ts sources. Furthermore, I'm of the opinion we should configure it to ignore types entirely (that is not its strong suit) and defer to typescript-eslint and/or tsc.

Note

#2682 is not a prerequisite to landing a solution here.

cc @turadg

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions