0

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.

2 Answers 2

0

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.