Add jshint config for tasks and remove lint
This commit is contained in:
@@ -97,6 +97,33 @@ function getNewer(date, newer, callback) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse the JSDoc output.
|
||||
* @param {string} output JSDoc output
|
||||
* @return {Object} Symbol and define info.
|
||||
*/
|
||||
function parseOutput(output) {
|
||||
if (!output) {
|
||||
throw new Error('Expected JSON output');
|
||||
}
|
||||
|
||||
var info;
|
||||
try {
|
||||
info = JSON.parse(String(output));
|
||||
} catch (err) {
|
||||
throw new Error('Failed to parse output as JSON: ' + output);
|
||||
}
|
||||
if (!Array.isArray(info.symbols)) {
|
||||
throw new Error('Expected symbols array: ' + output);
|
||||
}
|
||||
if (!Array.isArray(info.defines)) {
|
||||
throw new Error('Expected defines array: ' + output);
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Spawn JSDoc.
|
||||
* @param {Array.<string>} paths Paths to source files.
|
||||
@@ -142,33 +169,6 @@ function spawnJSDoc(paths, callback) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse the JSDoc output.
|
||||
* @param {string} output JSDoc output
|
||||
* @return {Object} Symbol and define info.
|
||||
*/
|
||||
function parseOutput(output) {
|
||||
if (!output) {
|
||||
throw new Error('Expected JSON output');
|
||||
}
|
||||
|
||||
var info;
|
||||
try {
|
||||
info = JSON.parse(String(output));
|
||||
} catch (err) {
|
||||
throw new Error('Failed to parse output as JSON: ' + output);
|
||||
}
|
||||
if (!Array.isArray(info.symbols)) {
|
||||
throw new Error('Expected symbols array: ' + output);
|
||||
}
|
||||
if (!Array.isArray(info.defines)) {
|
||||
throw new Error('Expected defines array: ' + output);
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Given the path to a source file, get the list of provides.
|
||||
* @param {string} srcPath Path to source file.
|
||||
@@ -268,7 +268,7 @@ function main(callback) {
|
||||
if (require.main === module) {
|
||||
main(function(err) {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
process.stderr.write(err.message + '\n');
|
||||
process.exit(1);
|
||||
} else {
|
||||
process.exit(0);
|
||||
|
||||
Reference in New Issue
Block a user