function checkForEmptyLine(node,opts){if(applyDefaultIgnorePatterns&&defaultIgnoreRegExp.test(node.value)){return;}if(ignorePattern&&customIgnoreRegExp.test(node.value)){return;}var after=opts.after,before=opts.before;var prevLineNum=node.loc.start.line-1,nextLineNum=node.loc.end.line+1,commentIsNotAlone=codeAroundComment(node);var blockStartAllowed=options.allowBlockStart&&isCommentAtBlockStart(node),blockEndAllowed=options.allowBlockEnd&&isCommentAtBlockEnd(node),objectStartAllowed=options.allowObjectStart&&isCommentAtObjectStart(node),objectEndAllowed=options.allowObjectEnd&&isCommentAtObjectEnd(node),arrayStartAllowed=options.allowArrayStart&&isCommentAtArrayStart(node),arrayEndAllowed=options.allowArrayEnd&&isCommentAtArrayEnd(node);var exceptionStartAllowed=blockStartAllowed||objectStartAllowed||arrayStartAllowed;var exceptionEndAllowed=blockEndAllowed||objectEndAllowed||arrayEndAllowed;// ignore top of the file and bottom of the file
if(prevLineNum<1){before=false;}if(nextLineNum>=numLines){after=false;}// we ignore all inline comments
if(commentIsNotAlone){return;}var previousTokenOrComment=sourceCode.getTokenBefore(node,{includeComments:true});var nextTokenOrComment=sourceCode.getTokenAfter(node,{includeComments:true});// check for newline before
if(!exceptionStartAllowed&&before&&!lodash.includes(commentAndEmptyLines,prevLineNum)&&!(isCommentNodeType(previousTokenOrComment)&&astUtils.isTokenOnSameLine(previousTokenOrComment,node))){var lineStart=node.range[0]-node.loc.start.column;var range=[lineStart,lineStart];context.report({node:node,message:"Expected line before comment.",fix:function fix(fixer){return fixer.insertTextBeforeRange(range,"\n");}});}// check for newline after
if(!exceptionEndAllowed&&after&&!lodash.includes(commentAndEmptyLines,nextLineNum)&&!(isCommentNodeType(nextTokenOrComment)&&astUtils.isTokenOnSameLine(node,nextTokenOrComment))){context.report({node:node,message:"Expected line after comment.",fix:function fix(fixer){return fixer.insertTextAfter(node,"\n");}});}}//--------------------------------------------------------------------------
Checks if a comment node has lines around it (ignores inline comments)
@param {ASTNode} node The Comment node.
@param {Object} opts Options to determine the newline.
@param {boolean} opts.after Should have a newline after this line.
@param {boolean} opts.before Should have a newline before this line.
@returns {void}