Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
afiori
5y ago
0 comments
Save
Share
is there a way to use the typescript type checker on js files using jsdoc types?
0 comments
4 comments · 1 top-level
top
newest
oldest
emteycz
5y ago
· 3 in thread
Yes. Simply install TS and make a jsconfig.json file, Vscode will pick it up automatically.
tgv
5y ago
You need to add
// @ts-check
at the top of the file:
https://www.typescriptlang.org/docs/handbook/intro-to-js-ts....
moron4hire
5y ago
There is a config setting for enabling it globally now
https://www.typescriptlang.org/tsconfig#checkJs
afiori
OP
5y ago
I was missing this, thank you.
j
/
k
navigate · click thread line to collapse