lib/rules/comma-style.js
function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) {
            const text =
                sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) +
                sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]);
            const range = [previousItemToken.range[1], currentItemToken.range[0]];

            return function(fixer) {
                return fixer.replaceTextRange(range, getReplacedText(styleType, text));
            };
        }
function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) {
            const text =
                sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) +
                sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]);
            const range = [previousItemToken.range[1], currentItemToken.range[0]];

            return function(fixer) {
                return fixer.replaceTextRange(range, getReplacedText(styleType, text));
            };
        }
function getFixerFunction ( styleType , previousItemToken , commaToken , currentItemToken ) { const text = sourceCode . text . slice ( previousItemToken . range [ 1 ] , commaToken . range [ 0 ] ) + sourceCode . text . slice ( commaToken . range [ 1 ] , currentItemToken . range [ 0 ] ) ; const range = [ previousItemToken . range [ 1 ] , currentItemToken . range [ 0 ] ] ; return function ( fixer ) { return fixer . replaceTextRange ( range , getReplacedText ( styleType , text ) ) ; } ; }
Determines the fixer function for a given style.
@param {string} styleType comma style
@param {ASTNode} previousItemToken The token to check.
@param {ASTNode} commaToken The token to check.
@param {ASTNode} currentItemToken The token to check.
@returns {Function} Fixer function
@private
Determines the fixer function for a given style .