function checkDirectives(node){var directives=astUtils.getDirectivePrologue(node);if(!directives.length){return;}var firstDirective=directives[0];var hasTokenOrCommentBefore=!!sourceCode.getTokenBefore(firstDirective,{includeComments:true});// Only check before the first directive if it is preceded by a comment or if it is at the top of
// the file and expectLineBefore is set to "never". This is to not force a newline at the top of
// the file if there are no comments as well as for compatibility with padded-blocks.
if(firstDirective.leadingComments&&firstDirective.leadingComments.length||// Shebangs are not added to leading comments but are accounted for by the following.
node.type==="Program"&&hasTokenOrCommentBefore){if(expectLineBefore==="always"&&!hasNewlineBefore(firstDirective)){reportError(firstDirective,"before",true);}if(expectLineBefore==="never"&&hasNewlineBefore(firstDirective)){reportError(firstDirective,"before",false);}}else if(node.type==="Program"&&expectLineBefore==="never"&&!hasTokenOrCommentBefore&&hasNewlineBefore(firstDirective)){reportError(firstDirective,"before",false);}var lastDirective=directives[directives.length-1];var statements=node.type==="Program"?node.body:node.body.body;// Do not check after the last directive if the body only
// contains a directive prologue and isn't followed by a comment to ensure
// this rule behaves well with padded-blocks.
if(lastDirective===statements[statements.length-1]&&!lastDirective.trailingComments){return;}if(expectLineAfter==="always"&&!hasNewlineAfter(lastDirective)){reportError(lastDirective,"after",true);}if(expectLineAfter==="never"&&hasNewlineAfter(lastDirective)){reportError(lastDirective,"after",false);}}//--------------------------------------------------------------------------
Check lines around directives in node
@param {ASTNode} node - node to check
@returns {void}