function reportUnnecessaryBraceError(node,bodyNode,name,suffix){context.report({node:node,loc:(name!=="else"?node:getElseKeyword(node)).loc.start,message:"Unnecessary { after '{{name}}'{{suffix}}.",data:{name:name,suffix:suffix?" "+suffix:""},fix:function fix(fixer){// `do while` expressions sometimes need a space to be inserted after `do`.
// e.g. `do{foo()} while (bar)` should be corrected to `do foo() while (bar)`
var needsPrecedingSpace=node.type==="DoWhileStatement"&&sourceCode.getTokenBefore(bodyNode).end===bodyNode.start&&esUtils.code.isIdentifierPartES6(sourceCode.getText(bodyNode).charCodeAt(1));var openingBracket=sourceCode.getFirstToken(bodyNode);var closingBracket=sourceCode.getLastToken(bodyNode);var lastTokenInBlock=sourceCode.getTokenBefore(closingBracket);if(needsSemicolon(closingBracket)){/*
                         * If removing braces would cause a SyntaxError due to multiple statements on the same line (or
                         * change the semantics of the code due to ASI), don't perform a fix.
                         */return null;}var resultingBodyText=sourceCode.getText().slice(openingBracket.range[1],lastTokenInBlock.range[0])+sourceCode.getText(lastTokenInBlock)+sourceCode.getText().slice(lastTokenInBlock.range[1],closingBracket.range[0]);return fixer.replaceText(bodyNode,(needsPrecedingSpace?" ":"")+resultingBodyText);}});}
Reports "Unnecessary { after ..." error
@param {ASTNode} node The node to report.
@param {ASTNode} bodyNode The block statement that is incorrectly surrounded by parens
@param {string} name The name to report.
@param {string} suffix Additional string to add to the end of a report.
@returns {void}
@private