Hacker News new | ask | show | jobs
by antiufo 3204 days ago
The JavaScript intellisense engine of previous versions of Visual Studio used to instrument a sandboxed JS engine in order to extract the shape of objects and methods used in the code, so it also worked when unusual idioms for structuring code were used. Recent versions use instead the TypeSript compiler, with support for plain JavaScript and flow analysis.
1 comments

Recent versions of Typescript also pay attention to JSDoc type hints and will even check them for you and start reporting "lint errors" if you just add a `// @ts-check` magic comment to the file. It can be a particularly quick way to bootstrap a project with a lot of JS a file at a time towards static typing. (Personally, I still prefer the "rip off the bandaid" approach of just renaming every JS file to TS and fix compile errors until it builds, but it's great to have options.)