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 (22) -

  • Jay Wolters

    2/3/2017 8:55:36 PM | Reply

    Thanks - this was driving me crazy.

  • Anh Le

    3/31/2017 3:37:42 AM | Reply

    Great! Thanks for sharing.

  • ogm

    4/5/2017 10:59:28 PM | Reply

    Finally, a clear and straight solution. Thanks

  • Paul Stubbs

    5/1/2017 5:47:29 AM | Reply

    The Windows version is now File / preferences / settings and on the Mac version it is located at Code / preferences / settings

  • Dariano

    6/1/2017 4:26:08 PM | Reply

    Great! Thanks.

  • Michael Beswick

    9/8/2017 9:13:27 AM | Reply

    Thanks, that was really bothering me!

  • Andre

    12/6/2017 10:52:48 AM | Reply

    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)`

  • Gerson

    12/16/2017 4:00:15 AM | Reply

    Thank you! Just great!

  • Marcio

    1/8/2018 4:33:27 PM | Reply

    Greats, it helps me a lot!

  • robbin

    1/28/2018 7:21:42 PM | Reply

    Thank you! Smile

  • Malika Foreman

    3/5/2018 8:32:14 PM | Reply

    Unfortunately this did not work for me...
    I added the line of code to the user settings as well as the workplace settings

  • sebastian

    3/7/2018 11:20:38 PM | Reply

    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).

  • Chris Simon

    3/9/2018 4:01:09 AM | Reply

    Thanks!!

  • Harshit Juneja

    9/3/2018 7:26:53 AM | Reply

    Thanks Donovan. This posts must be helping more people than you think.

  • HugeHard

    11/6/2018 7:34:03 PM | Reply

    those dam squiggles follow me wherever i go.
    whether its .py or .js, squiggles everywhere...

  • Carlos

    3/15/2019 9:53:17 AM | Reply

    Thank you ! It's work ;)

  • OWen

    6/18/2019 11:12:51 PM | Reply

    The version 6 worked for me, how can I enable es9 in jshint because the jshint.option is showing me that it can't accept array

  • Owen

    6/19/2019 8:20:41 AM | Reply

    How can jshint.option be set to accept esversion9

  • Gabe

    3/7/2020 4:13:53 AM | Reply

    Here in 2020, this post has alleviated so much annoyance. Thank you!

  • David Kramer

    7/14/2020 2:57:08 PM | Reply

    Thanks.  Short and to the point.

  • Rex

    8/25/2020 5:26:23 PM | Reply

    Great post, this was really helpful!

Add comment

Loading