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:
- The
--strictNullChecksflag (allowing finer control over undefined / nullable properties:myProperty: string | null | undefined). - The new way to install community types definitions
npm install --save @types/lodash.
# 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/
- On Linux it should be:
- [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 Settingsinstead 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
- Open your configuration file:
- [Atom Editor] Use typescript@next:
- Install the
atom-typescriptpackage. - Go to the Settings for the
atom-typescriptpackage. - Edit
Full path (including file name) to a custom typescriptServices.jswith:[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
- Install the
- Extra - [ts-loader and webpack] - Use typescript@next:
- If you use
ts-loaderto compile your .ts files, just runnpm link typescriptso it can use your globally installed version of typescript.
- If you use
You're done :)









