function validateCommaItemSpacing(previousItemToken,commaToken,currentItemToken,reportItem){// if single line
if(astUtils.isTokenOnSameLine(commaToken,currentItemToken)&&astUtils.isTokenOnSameLine(previousItemToken,commaToken)){// do nothing.
}else if(!astUtils.isTokenOnSameLine(commaToken,currentItemToken)&&!astUtils.isTokenOnSameLine(previousItemToken,commaToken)){// lone comma
context.report({node:reportItem,loc:{line:commaToken.loc.end.line,column:commaToken.loc.start.column},message:"Bad line breaking before and after ','.",fix:getFixerFunction("between",previousItemToken,commaToken,currentItemToken)});}else if(style==="first"&&!astUtils.isTokenOnSameLine(commaToken,currentItemToken)){context.report({node:reportItem,message:"',' should be placed first.",fix:getFixerFunction(style,previousItemToken,commaToken,currentItemToken)});}else if(style==="last"&&astUtils.isTokenOnSameLine(commaToken,currentItemToken)){context.report({node:reportItem,loc:{line:commaToken.loc.end.line,column:commaToken.loc.end.column},message:"',' should be placed last.",fix:getFixerFunction(style,previousItemToken,commaToken,currentItemToken)});}}
Validates the spacing around single items in lists.
@param {Token} previousItemToken The last token from the previous item.
@param {Token} commaToken The token representing the comma.
@param {Token} currentItemToken The first token of the current item.
@param {Token} reportItem The item to use when reporting an error.
@returns {void}
@private