Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
AttUtil.doSequenceTasks(files, function (file, callback) {
var extname = path.extname(file).replace(/\./, "").toLowerCase();
//检查 js, css syntax
if(check === 'true' || (check !== 'false' && extname == "js" && checkJS)){
var results = jshint.hint([file]);
var len = results.length,
str = '',
file, error;
results.forEach(function (result) {
file = result.file;
error = result.error;
str += file + ': line ' + error.line + ', col ' +
error.character + ', ' + error.reason + '\n';
});
if (str) {
console.log(str + "\n" + len + ' error' + ((len === 1) ? '' : 's') + "\n");
}else{
console.log("jshint Perfect: %s", file);
}
glob(query, function (err, matches) {
matches.forEach(function(item){
var stat = fs.statSync(item);
if(stat.isFile() && item.match(/\.js$/i)){
files.push(item);
}
});
if(files.length == 0){
return console.log("no js file matched");
}
if (jshint.hint(files).length === 0) {
console.log("Perfect!");
}
});
};