问题描述
JSLint只适用于一个JavaScript文件。最近,我开始将我的程序分成几个部分。
JSLint works fine for just one JavaScript file. Recently, I've started breaking my program into several pieces.
每次我使用JSLint检查代码时,我都不想将这些部分串起来。使用JSLint处理多个文件的标准解决方案是什么?
I don't want to be stringing the pieces each time I use JSLint to check my code. What is the standard solution to deal with multiples files with JSLint?
推荐答案
有一个版本的JSLint(node-JSLint)(命令行),允许您一次检查多个文件。请点击链接在GitHub下载:
There is a version of JSLint (node-JSLint) (command line) that allows you to check multiple files at once. Follow link for download at GitHub:
以下通过命令行调用的示例:
The following examples of calling via the command line:
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
注意:此应用程序是为NodeJS开发的。
Note: This application was developed to NodeJS.
这篇关于带有多个文件的JSLint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!