lib/rules/require-class-comment.js
function requireJsDoc(node, isVirtual, paramsToCheck) {
		var lines = sourceCode.lines;
		var index = node.loc.start.line;
		lines = lines.slice(0, index);
		var matches = lines.filter(function(line) {
			return line.match(/\/\*\*/gi);
		});

		var lastIndex = lines.lastIndexOf(matches[matches.length - 1]);

		var jsdocComment = findJSDocComment(sourceCode.ast.comments, lastIndex);
		if (!jsdocComment) {
			report(node);
			return;
		}

		checkJSDoc(node, jsdocComment, isVirtual, paramsToCheck);
	}
function requireJsDoc(node, isVirtual, paramsToCheck) {
		var lines = sourceCode.lines;
		var index = node.loc.start.line;
		lines = lines.slice(0, index);
		var matches = lines.filter(function(line) {
			return line.match(/\/\*\*/gi);
		});

		var lastIndex = lines.lastIndexOf(matches[matches.length - 1]);

		var jsdocComment = findJSDocComment(sourceCode.ast.comments, lastIndex);
		if (!jsdocComment) {
			report(node);
			return;
		}

		checkJSDoc(node, jsdocComment, isVirtual, paramsToCheck);
	}
function requireJsDoc ( node , isVirtual , paramsToCheck ) { var lines = sourceCode . lines ; var index = node . loc . start . line ; lines = lines . slice ( 0 , index ) ; var matches = lines . filter ( function ( line ) { return line . match ( / \/\*\* / gi ) ; } ) ; var lastIndex = lines . lastIndexOf ( matches [ matches . length - 1 ] ) ; var jsdocComment = findJSDocComment ( sourceCode . ast . comments , lastIndex ) ; if ( ! jsdocComment ) { report ( node ) ; return ; } checkJSDoc ( node , jsdocComment , isVirtual , paramsToCheck ) ; }
Check if the jsdoc comment is present or not.
@param {ASTNode} node node to examine
@returns {void}
Check if the jsdoc comment is present or not .