validate-jsdoc.js
function analyzeFunction(node) {
	var comment = node.leadingComments[0];
	if (comment.type !== 'Block') {
		return;
	}
	var data = doctrine.parse(comment.value, { unwrap: true });

	var params = [];
	data.tags.forEach(function (tag) {
		if (tag.title === 'param') {
			params.push(tag.name);
		}
	});

	var missing = [];
	node.params.forEach(function (param) {
		if (params.indexOf(param.name) < 0) {
			missing.push(param.name);
		}
	});
	if (missing.length > 0) {
		var msg = '';
		msg += 'In function ' + chalk.cyan(node.id.name) + ' (Line ' + node.loc.start.line + '):\n';
		missing.forEach(function (m) {
			msg += '  Parameter ' + chalk.cyan(m) + ' is not documented.';
		});
		throw new Error(msg);
	}
}
function analyzeFunction(node) {
	var comment = node.leadingComments[0];
	if (comment.type !== 'Block') {
		return;
	}
	var data = doctrine.parse(comment.value, { unwrap: true });

	var params = [];
	data.tags.forEach(function (tag) {
		if (tag.title === 'param') {
			params.push(tag.name);
		}
	});

	var missing = [];
	node.params.forEach(function (param) {
		if (params.indexOf(param.name) < 0) {
			missing.push(param.name);
		}
	});
	if (missing.length > 0) {
		var msg = '';
		msg += 'In function ' + chalk.cyan(node.id.name) + ' (Line ' + node.loc.start.line + '):\n';
		missing.forEach(function (m) {
			msg += '  Parameter ' + chalk.cyan(m) + ' is not documented.';
		});
		throw new Error(msg);
	}
}
function analyzeFunction ( node ) { var comment = node . leadingComments [ 0 ] ; if ( comment . type !== 'Block' ) { return ; } var data = doctrine . parse ( comment . value , { unwrap : true } ) ; var params = [ ] ; data . tags . forEach ( function ( tag ) { if ( tag . title === 'param' ) { params . push ( tag . name ) ; } } ) ; var missing = [ ] ; node . params . forEach ( function ( param ) { if ( params . indexOf ( param . name ) < 0 ) { missing . push ( param . name ) ; } } ) ; if ( missing . length > 0 ) { var msg = '' ; msg += 'In function ' + chalk . cyan ( node . id . name ) + ' (Line ' + node . loc . start . line + '):\n' ; missing . forEach ( function ( m ) { msg += '  Parameter ' + chalk . cyan ( m ) + ' is not documented.' ; } ) ; throw new Error ( msg ) ; } }
Take a function node and analyze its JsDoc comments
@param  {FunctionDeclaration} node  FunctionDeclaration esprima node
@return {null}
@throws {Error} Will throw when invalid JsDoc is encountered
Take a function node and analyze its JsDoc comments