Closed
Description
This is a suggestion/feature request for the @ts-check feature.
When using // @ts-check
in a JavaScript file, TypeScript-check should be able to identify object properties types using JSDoc.
For example:
// @ts-check
/*
* @param {Object} bar The bar object
* @param {Number} bar.id The id of the bar object
* @param {Object} bar.foo The foo object
* @param {Number} bar.foo.id The id of the foo object
*/
export function Foo(bar) {
console.log(bar.id); // TypeScript: "Holy moly it is a number"
console.log(bar.foo.id); // TypeScript: "OMG another one"
}
Also described on JSDoc.
I hope you get the idea :)
Keep up the good work!