$> man42.net Blog written by a human

typescript@next allows you to use features that will be available in the next TypeScript release.

# Benefits

In my case, I wanted to play with a few TypeScript 2.0 features before it got released, like:

# Setup Visual Studio Code and Atom to use typescript@next

  • Install typescript@next:
    • npm install -g typescript@next
    • Note: you can also install it locally to your project.
  • Figure out your typescript installation path:
    • On Linux it should be: echo `npm root -g`/typescript/
    • In my case it's /home/usename/Applications/nodejs/lib/node_modules/typescript/
  • [Visual Studio Code] Use typescript@next:
    • Open your configuration file:
      • File -> Preferences -> Workspace Settings
      • Note: This will only use typescript@next for your current Visual Studio Code workspace, you can select User Settings instead if you want to make the change global.
    • Add this line to your configuration file (on the right pane):
      • "typescript.tsdk": "[YOUR TYPESCRIPT INSTALLATION PATH]/lib"
      • Note: Replace [YOUR TYPESCRIPT INSTALLATION PATH] with your typescript installation path ;) Don't forget the "/lib" part at the end!
      • Note 2: Visual Studio Code also accepts relative paths (example: ./node_modules/typescript/lib)
    • Restart Visual Studio Code
  • [Atom Editor] Use typescript@next:
    • Install the atom-typescript package.
    • Go to the Settings for the atom-typescript package.
    • Edit Full path (including file name) to a custom typescriptServices.js with:
      • [YOUR TYPESCRIPT INSTALLATION PATH]/lib/typescriptServices.js
      • Note: Replace [YOUR TYPESCRIPT INSTALLATION PATH] with your typescript installation path ;) Don't forget the "/lib/typescriptServices.js" part at the end!
    • Restart Atom Editor
  • Extra - [ts-loader and webpack] - Use typescript@next:
    • If you use ts-loader to compile your .ts files, just run npm link typescript so it can use your globally installed version of typescript.

You're done :)

Buffer this pageShare on TumblrDigg thisShare on FacebookShare on LinkedInTweet about this on TwitterEmail this to someoneShare on Google+Share on RedditPin on Pinterest