문제

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