Skip to content

no-undefined-types doesn't read local variables #178

Closed
@cowwoc

Description

@cowwoc

Given:

var ForwardDeclaration;

/**
 * Initializes the exported variables if they haven't been initialized before. See
 * <a href="https://stackoverflow.com/a/42704874/14731">Stackoverflow</a> for a related discussion.
 *
 * @return {undefined}
 */
function initExports()
{
	if (ForwardDeclaration)
		return;

	class TestClass
	{
		constructor(name)
		{
			// eslint-disable-next-line no-console
			console.log(name);
		}

		/**
		 * @param {TestClass} other another instance of {@code TestClass}
		 * @return {TestClass} this
		 */
		isEqualTo(other)
		{
			return this;
		}
	}

	ForwardDeclaration = TestClass;
}

initExports();

export {ForwardDeclaration as TestClass, initExports};

The plugin complains The type 'TestClass' is undefined. on line 23 (the @param). I am expecting a method to know about its enclosing class.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions