function checkSpacingInsideBraces(node){// Gets braces and the first/last token of content.
var openBrace=getOpenBrace(node);var closeBrace=sourceCode.getLastToken(node);var firstToken=sourceCode.getTokenAfter(openBrace,{includeComments:true});var lastToken=sourceCode.getTokenBefore(closeBrace,{includeComments:true});// Skip if the node is invalid or empty.
if(openBrace.type!=="Punctuator"||openBrace.value!=="{"||closeBrace.type!=="Punctuator"||closeBrace.value!=="}"||firstToken===closeBrace){return;}// Skip line comments for option never
if(!always&&firstToken.type==="Line"){return;}// Check.
if(!isValid(openBrace,firstToken)){context.report({node:node,loc:openBrace.loc.start,message:"{{message}} after '{'.",data:{message:message},fix:function fix(fixer){if(always){return fixer.insertTextBefore(firstToken," ");}return fixer.removeRange([openBrace.range[1],firstToken.range[0]]);}});}if(!isValid(lastToken,closeBrace)){context.report({node:node,loc:closeBrace.loc.start,message:"{{message}} before '}'.",data:{message:message},fix:function fix(fixer){if(always){return fixer.insertTextAfter(lastToken," ");}return fixer.removeRange([lastToken.range[1],closeBrace.range[0]]);}});}}
Reports invalid spacing style inside braces.
@param {ASTNode} node - A BlockStatement/SwitchStatement node to get.
@returns {void}