Skip to content

Instantly share code, notes, and snippets.

@zigomir
Last active April 29, 2016 22:41
Show Gist options
  • Save zigomir/b5ba9efba7f30bbe8ed6de4533075366 to your computer and use it in GitHub Desktop.
Save zigomir/b5ba9efba7f30bbe8ed6de4533075366 to your computer and use it in GitHub Desktop.
Visual Studio Code and JS IntelliSense

Visual Studio Code and JS IntelliSense

  • You need to have jsconfig.json in your project root directory
{
  "compilerOptions": {
    "target": "es2015",
    "module": "commonjs",
    "allowSyntheticDefaultImports": true
  },
  "exclude": [
    "node_modules"
  ]
}
  • Install typings as global npm module
npm install -g typings
  • Install Typing installer VSCode extension.
  • Install typings for libraries you use - node, jQuery, vue, ...

Caveats

  • To be able to navigate (cmd + click) ES6 style modules you need to specify it as target of compilerOptions inside jsconfig.json file.
  • use allowSyntheticDefaultImports: true when you use ES6 modules in your JS and you want to have TypeScript typings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment