Skip to content

Nonsensical special types are uncaught by check-types #416

@binury

Description

@binury

Recently we observed a developer, who was unfamiliar with JSDoc, attempt to define a type like this:

  /**
   * @param {Object<Object>}
   */

I thought it odd that this was not detected by the linter. I checked if this was a special case but found that there was no such check performed on special types because

  /**
   * @param {string<Object>}
   */

is also passed. 👎

  /**
   * @param {string<>}
   */

however is invalidated because the subtype is nonexistent. 👍

AFAIK special types apply in at least two cases:

  1. Array and
  2. Promise

would it be possible to catch any type defined outside of these?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions