Skip to content

[valid-types] fails with type "this" #1554

@danielrentz

Description

@danielrentz

Expected behavior

A @returns declaration for class methods with type {this} used to work for a long time:

class Test { /**  * @returns {this}  */ method() { return this; } }

but fails after updating to v60.7. Is this a problem in this plugin, or in the underlying type parser?

Actual behavior

135:1 error Syntax error in type: this jsdoc/valid-types

ESLint Config

rules: { "jsdoc/valid-types": "error", }

settings.jsdoc.mode is the default (i.e. typescript).

Environment

  • Node version: 22.18
  • ESLint version 9.37
  • eslint-plugin-jsdoc version: 60.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions