3 ms·
In JS, undefined is also typical for uninitialized fields and variables, so undefined can show up without a typo. And if you've got typos, why not use e.g. Type
by tgv 6y ago
In JS, undefined is also typical for uninitialized fields and variables, so undefined can show up without a typo. And if you've got typos, why not use e.g. TypeScript?
- afiori 6y agois there a way to use the typescript type checker on js files using jsdoc types?
- emteycz 6y agoYes. Simply install TS and make a jsconfig.json file, Vscode will pick it up automatically.
- tgv 6y agoYou need to add // @ts-check at the top of the file: https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html https://www.typescriptlang.org/docs/handbook/intro-to-js-ts....
- moron4hire 6y agoThere is a config setting for enabling it globally now https://www.typescriptlang.org/tsconfig#checkJs https://www.typescriptlang.org/tsconfig#checkJs
- afiori 6y agoI was missing this, thank you.