3 ms·
VS Code's JS support is actually still powered by TypeScript. I'm not 100% sure exactly what you were experiencing, but it's intentional that VS and VS Code aut
by DanRosenwasser 6y ago
VS Code's JS support is actually still powered by TypeScript. I'm not 100% sure exactly what you were experiencing, but it's intentional that VS and VS Code automatically download types when powering JavaScript contexts because we try to make things "just work" for JS users.
- hombre_fatal 6y agoI don't think you are saying anything in conflict with me. VSCode tries to give you type info in contexts where Typescript wouldn't (e.g. importing Javascript files, in a completely non-TS project) so it makes sense that its inference tooltip can be more helpful. You can easily recreate this by importing a fn from a JS module and then hovering it in VSCode (also configured for Typescript): VSCode knows the fn signature but Typescript won't. Both cases show up in the tooltip (though confusingly). At least, that's my interpretation of this sort of tooltip: https://i.imgur.com/lXS5teK.png https://i.imgur.com/lXS5teK.png And to be clear, your last sentence was my exact praise for VSCode at the end of my own comment.
- tomnipotent 6y ago> intentional that VS and VS Code automatically download types Are these coming from DefinitelyTyped?
- WorldMaker 6y agoIndirectly, sometimes. They come from npm, but the largest chunk of type packages for libraries that do not provide their own types on npm are serviced from DefinitelyTyped (via the `@types` organization and its long tail of shadow packages).