13

I am playing around with VS 2015 JavaScript/NodeJS IDE and I plan to use ES6 as the language style for JavaScript, however I am noticing that Visual Studio is not recognizing the ES6 (even though I read on various web sites that VS should recognize ES6).

Does anyone know how to make VS 2015 play nice (both in syntax highlighting, intellisense, etc) with ES6?

es6-errors

I also modified the file extension to be .JSX and .ES6 in case that would help VS pick up on it. No luck...

E.S.
  • 2,733
  • 6
  • 36
  • 71

3 Answers3

8

If you want IntelliSense for ES6 in a nodejs project, then you need to turn on a particular setting.

Open Tools → Options → Text editor → Node.js → IntelliSense and select the ES6 IntelliSense Preview checkbox.

In the December 2015 version of the tools, there is a link to additional notes about the prerequisites, such as having to install TypeScript for Visual Studio 2015 so that ES6 IntelliSense works.

Pierre Arnaud
  • 10,212
  • 11
  • 77
  • 108
Don
  • 6,632
  • 3
  • 26
  • 34
  • 1
    In my installation there is no Node.js option section – Shawn Nov 02 '15 at 04:16
  • 2
    @Shawn, it's actually at `tools > options> text editor > node.js > intellisense`. You'll have to install [typescript 1.6](https://www.microsoft.com/en-us/download/details.aspx?id=48593) in order to enable ES6 intellisense. – sunny moon Dec 15 '15 at 09:38
3

@Shawn, in order to enable the Node.js options (and ES6 IntelliSense) you need to install the Visual Studio NodeJS Tools: https://www.visualstudio.com/en-us/features/node-js-vs.aspx

0

Try install TypeScript for Visual Studio 2015 and restart VS2015. https://www.microsoft.com/en-us/download/details.aspx?id=48593

I resolve many problem with this.

Jie Wang
  • 620
  • 1
  • 10
  • 17