Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I set the ES6 option for jshint?

I tried:

/*jshint esversion: 6 */

but got an error when running grunt:

enter image description here

This is supposed to be the preferred method as esnext is being deprecated. See here - http://jshint.com/docs/options/#esnext

like image 565
cade galt Avatar asked Jan 16 '16 20:01

cade galt


People also ask

How do I enable Jshint in Vscode?

In order to disable jshint for a workspace specify "jshint. enable" : false in the workspace settings. jshint is enabled by default.

How do I ignore Jshint warning?

In October 2013 jshint added a way to ignore blocks of code like this: // Code here will be linted with JSHint. /* jshint ignore:start */ // Code here will be ignored by JSHint. /* jshint ignore:end */ // Code here will be linted with JSHint. Show activity on this post. Show activity on this post.

What is Jshintrc file?

JSHint is a program that flags suspicious usage in programs written in JavaScript. The core project consists of a library itself as well as a CLI program distributed as a Node module.


1 Answers

You can set the 'esversion' option in your gruntfile.js, like so:

jshint: {
    files: ['dist/*.js'],
    options: {
        'esversion': 6,
    }
},
like image 54
gregsmi Avatar answered Sep 17 '22 14:09

gregsmi