Skip to content

jsdoc/no-undefined-types throws error for globalThis[keyName] (and maybe other types) #1566

@what1s1ove

Description

@what1s1ove

Hey guys! First of all, thanks for such an awesome plugin!

Expected behavior

W/o the jsdoc/no-undefined-types error:

class Storage {
	/** @type {globalThis.localStorage} */
	#storage
}

Actual behavior

The type 'globalThis.localStorage' is undefined jsdoc/no-undefined-types

class Storage {
	/** @type {globalThis.localStorage} */
	#storage
}

That resolves the issue, but of course, it would be nice to be able to use globalThis:
Image

Environment

  • Node version: 20.19.5
  • ESLint version 9.37.0
  • eslint-plugin-jsdoc version: 61.1.1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions