When WebStorm writes a Vue project, it reports an error message SHint ‘const’ is available in ES6(use ‘esversion 6’) or Mozilla JS extensions

Hits: 0

When we write Vue.js related language in [WebStorm] , the red wavy line prompts: JSHint: ‘const’ is available in ES6(use ‘esversion: 6″) or Mozilla JS extensions (use moz).(W104), red wavy line looks uncomfortable

The translation roughly means: JSHint: “Const” is available in [ES6] (using “esversion:6”) or a Mozilla JS extension (using Moz).
That is to say, it is only supported under the ES6 version syntax, and we can solve it in the following way.

Method 1: Comment /* jshint esversion: 6 */, there is no error message in the code, but there is still a red squiggly line in the comment, which is already very uncomfortable, and the error message prompts to Edit .jshinttrcedit the configuration file .jshintrc.
Method 2: Configure the global file.jshintrc

  1. Custom .jshintrc: Create a file named .jshintrc and write the following code

{
  "esversion": 6
}

  1. In webstorm: File->settings->Languages & Framworks->JavaScript->Code QualityTools ->JShint
    select the file path that you customized and configured before
    . After configuration, the problem is solved, and finally there is no such annoying wavy line
Another common error:JSHint: Missing semicolon.

That is, the semicolon is missing in the js code, and the semicolon can be added to the missing place.

You may also like...

Leave a Reply

Your email address will not be published.