I have a file called test.d.ts with this declaration:
export type Person = {
name: string
}
and a test.js file with this content:
/** @type {import('./test').Person} */
let person;
person = {
name2: "sdf",
};
And it doesn't work. VSCode properly displays the Person type when I hover it, but the (wrong) assignment doesn't trigger an error.
What am I doing wrong?
Putting the type in a file with a different name (e.g.: foo.d.ts) and importing from there, works properly.