function report(property,side,whitespace,expected,mode){var diff=whitespace.length-expected,nextColon=getNextColon(property.key),tokenBeforeColon=sourceCode.getTokenBefore(nextColon,{includeComments:true}),tokenAfterColon=sourceCode.getTokenAfter(nextColon,{includeComments:true}),isKeySide=side==="key",locStart=isKeySide?tokenBeforeColon.loc.start:tokenAfterColon.loc.start,isExtra=diff>0,diffAbs=Math.abs(diff),spaces=Array(diffAbs+1).join(" ");var fix=void 0;if((diff&&mode==="strict"||diff<0&&mode==="minimum"||diff>0&&!expected&&mode==="minimum")&&!(expected&&containsLineTerminator(whitespace))){if(isExtra){var range=void 0;// Remove whitespace
if(isKeySide){range=[tokenBeforeColon.end,tokenBeforeColon.end+diffAbs];}else{range=[tokenAfterColon.start-diffAbs,tokenAfterColon.start];}fix=function fix(fixer){return fixer.removeRange(range);};}else{// Add whitespace
if(isKeySide){fix=function fix(fixer){return fixer.insertTextAfter(tokenBeforeColon,spaces);};}else{fix=function fix(fixer){return fixer.insertTextBefore(tokenAfterColon,spaces);};}}context.report({node:property[side],loc:locStart,message:messages[side],data:{error:isExtra?"Extra":"Missing",computed:property.computed?"computed ":"",key:getKey(property)},fix:fix});}}
Reports an appropriately-formatted error if spacing is incorrect on one
side of the colon.
@param {ASTNode} property Key-value pair in an object literal.
@param {string} side Side being verified - either "key" or "value".
@param {string} whitespace Actual whitespace string.
@param {int} expected Expected whitespace length.
@param {string} mode Value of the mode as "strict" or "minimum"
@returns {void}