Question

Is there a way to configure IntelliJ IDEA / WebStorm to add // jshint ignore:line in order to suppress JSHint warnings? By default, IntelliJ adds //noinspection JSHint, which is not recognized by JSHint itself.

Was it helpful?

Solution

It's not possible to configure Inspections Quick fix result right now. When you're trying to suppress warning via Quick fix (Alt+Enter) in WebStorm/Intellij IDEA - predefine comment //noinspection JSHint is added for any JSHint warning. So you need to add // jshint ignore:line manually to make sure this warning will be suppressed by JSHint itself.

OTHER TIPS

If the developers want to ignore a block of code they can use the following directive:

/* jshint ignore:start */

Code here will be ignored by JSHint.

/* jshint ignore:end */

all the code between ignore:start and ignore:end won't be passed to JS Hint. and as specified above you can ignore a single line with a trailing comment: ignoreThis(); // jshint ignore:line

For example : Developers can use Java script language extensions such as coffee script, Face book react, etc without the static code profiler being triggered.

In order to exclude files during build process using maven developers can use excludes tag in maven plugin for JSHint.

Example: src/main/webapp/myScript.js src/main/webapp/myDirectory .
Note: excludes are resolved relative to the basedir of the module

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top