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.

有帮助吗?

解决方案

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.

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top