在我用于项目的 pom.xml 文件中,我为 jsLint 设置了以下内容:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jslint-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<goals>
<goal>jslint</goal>
<goal>test-jslint</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>**/vendor/*</exclude>
</excludes>
</configuration>
</plugin>
在我的 js 文件的顶部,我有以下内容:
/*jslint nomen: true, browser: true, devel: true*/
在文件中,我有一个名为:
Api.prototype._call = function (query) {...};
我这样称呼:
Api.prototype.product = function (options) {
...
return this._call(query);
};
现在对于奇怪的事情......
如果我用它编译它,mvn clean install
我会收到以下错误消息:
api.js:45:29:Unexpected dangling '_' in '_call'.
但是,如果我恢复 nomen 的标志,说nomen: false
mvn 不会抱怨!
另一方面,这导致 IntelliJ_call
用红色标记标记代码的一部分,因为它正在使用 jsLint。