带有多个文件的JSLint

Ran*_*lue 23 javascript jslint

JSLint只适用于一个JavaScript文件.最近,我开始将我的程序分成几部分.

每次我使用JSLint检查代码时,我都不想将这些部分串起来.使用JSLint处理多个文件的标准解决方案是什么?

Ner*_* Jr 23

有一个版本的JSLint(node-JSLint)(命令行)允许您一次检查多个文件.点击链接在GitHub下载:

https://github.com/reid/node-jslint

以下通过命令行调用的示例:

JSLint app.js
JSLint lib / lib worker.js / server.js # Multiple files
JSLint - white - onevar - regexp app.js JSLint # All options supported
JSLint - bitwise false app.js # Defaults to true, but You Can Specify false
JSLint - goodparts - # undef false app.js The Good Parts, except undef
JSLint-gp app.js # Shorthand for - goodparts:-gp
find . -name "*.js" -print0 | xargs -0 jslint # JSLint JSLint your Entire Project
Run Code Online (Sandbox Code Playgroud)

注意:此应用程序是为NodeJS开发的.


Dan*_*ott 14

运行命令有什么问题?

jslint .
Run Code Online (Sandbox Code Playgroud)

将检查当前目录中的所有js文件并递归树.

  • ...将包含node_modules目录中的所有内容. (6认同)