How to suppress jshint W030 warning on "use strict" statement in VSCode?

104 Views Asked by At

I use jshint extension in VSCode. Even for the simplest JS file like this

{
    "use strict";

    let a = "Hello world!";
    console.log(a);
}

I get the warning:

Expected an assignment or function call and instead saw an expression. jshint(W030) [Ln 2, Col 5]

How to suppress this warning?

1

There are 1 best solutions below

1
Milo On

you can try adding at the end of the line with that problem this comment //jshint ignore:line

For instance:

{   
"use strict"; //jshint ignore:line 
let a = "Hello world!";
console.log(a); 
}