Thanks for the feedback. Actually originally I only used JSDoc for creating HTML documentation. But that was before TypeScript, etc. After VSCode came along with builtin support for type analyzation through JSDoc, I started exploring how to take full advantage of it for type checking.
Yeah, that’s the one limitation of JSDoc type imports, you have to import each one at a time. The is no import all types from a file currently. This is more a result of how VSCode and TypeScript teams have decided to handle type imports for JSDoc.
Do you mean live linting or at build time along with ESLint, etc.?
To do at build time, just add a script to your
"checkjs": "tsc --allowJs --checkJs --noEmit --moduleResolution node --target ES6 src/*.js"
const name = 'Joe'
It will assume that name is of type
string. However, there are cases where a variable could be of…