Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to turn on ES6/ES7 syntax support in vscode?

Edit 3: Starting in version 0.4.0, ES6 syntax can be turned on by adding a jsconfig.json file to the project folder with the following contents:

{     "compilerOptions": {         "target": "ES6"     } } 

Edit 2: You can vote for this feature on user voice


Is there a way to "turn on" ES6/ES7 in Visual Studio Code?

screenshot

Edit 1

Tried @sarvesh's suggestion- overrode javascript.validate.target and restarted vscode. Didn't help.

like image 855
Jeremy Danyow Avatar asked Apr 29 '15 19:04

Jeremy Danyow


People also ask

How do I enable JavaScript suggestions in Visual Studio code?

You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.) in JavaScript).

How do I enable reference in VS code?

Step 1: From Settings – Type CodeLens and Enable the Editor: Code Lens and JavaScript > References Code Lens to check the references in JavaScript File.

How do I get the JavaScript console code in Visual Studio?

Open the JavaScript file in VSCode, then use shortcut Ctrl + Alt + N , the code will run and the output will be shown in the Output Window.


1 Answers

It's quite easy, at the root of your project create a jsconfig.json file and write this object in it:

{     "compilerOptions": {         "target": "ES6",         "module": "commonjs"     } } 
like image 176
Oliv Avatar answered Nov 09 '22 21:11

Oliv