Enabling jshint es6 support in VS Code

I was recently working on a Node project and when I copy and pasted code from the Node Docs I would get squiggles.

image

Unfortunately, reading the tool tip was little help.

image

I had no idea where I was supposed to place these values to correct this issue.  After some searching I discovered I needed adjust my workspace settings.

  1. Select File / Preferences / Workspace Settings
    image
  2. Paste the following code in the settings.json file
    "jshint.options": {"esversion": 6},
  3. Save the settings.json file
    image

Comments (14) -

  • Great! Thanks for sharing.
  • ogm
    Finally, a clear and straight solution. Thanks
  • The Windows version is now File / preferences / settings and on the Mac version it is located at Code / preferences / settings
  • Thanks! Works great, Is there also a way to allow spread operators? I still get an error
    `[jshint] Expected '}' to match '{' from line 64 and instead saw '...'. (E020)`
  • Thank you! Just great!
  • Greats, it helps me a lot!
  • Unfortunately this did not work for me...
    I added the line of code to the user settings as well as the workplace settings
  • Thanks in 2018 this worked for me as now its File > Settings > Workplace Settings and then just copy your code and paste it in the file, save it, and then VS Code removes the E6 problems (warnings).

Add comment

Loading