I'm writing JavaScript (ES6) code in Visual Studio Code and enabled VSCode's type checking as explained in the VSCode docs.
When referring to a type that is defined in another file (Track in the example below), I get an error like [js] Cannot find name 'Track' at the JSDoc reference to that type unless I import it. When I import this type, I get an error from ESLint: [eslint] 'Track' is defined but never used. (no-unused-vars)
I don't want to disable the ESLint rule. Is there a way to import the type only for the type checks in VSCode?
import Track from "./Track";
export default class TrackList {
/**
* Creates a new track list.
* @param {Iterable<Track>} tracks the tracks to include
*/
constructor(tracks) {
this._tracks = tracks ? Array.from(tracks) : [];
}
...

Trackto the globals in ESLint config?Trackto globals does not help. JSDoc needs a reference to the source code. Disabling rules would help, but I don't like to disable the rule entirely as this would limit the use of ESLint. Disabling it only for certain names works via the varsignorepattern option but using this pattern in every other file would be rather ugly.