Pattern: Implements on non-constructor
Issue: -
The @implements tag should only be used on class constructors or functions marked with @class. Using it on regular functions is incorrect as they cannot implement interfaces.
Example of incorrect code:
/**
* @implements {Interface}
*/
function normalFunction() {}
Example of correct code:
/**
* @implements {Interface}
*/
class MyClass {
constructor() {}
}
/**
* @implements {Interface}
* @class
*/
function ClassFunction() {}