lib/rules/no-arrow-functions.js
function toFunctionExpression(node) {
            const params = node.params
            const paramText = params.length
                ? sourceCode.text.slice(
                      params[0].range[0],
                      params[params.length - 1].range[1]
                  )
                : ""

            const arrowToken = sourceCode.getTokenBefore(
                node.body,
                isArrowToken
            )
            const preText = sourceCode.text.slice(
                arrowToken.range[1],
                node.body.range[0]
            )
            const bodyText = sourceCode.text.slice(
                arrowToken.range[1],
                node.range[1]
            )

            if (node.body.type === "BlockStatement") {
                return `function(${paramText})${bodyText}`
            }
            if (preText.includes("\n")) {
                return `function(${paramText}){return(${bodyText})}`
            }
            return `function(${paramText}){return ${bodyText}}`
        }
function toFunctionExpression(node) {
            const params = node.params
            const paramText = params.length
                ? sourceCode.text.slice(
                      params[0].range[0],
                      params[params.length - 1].range[1]
                  )
                : ""

            const arrowToken = sourceCode.getTokenBefore(
                node.body,
                isArrowToken
            )
            const preText = sourceCode.text.slice(
                arrowToken.range[1],
                node.body.range[0]
            )
            const bodyText = sourceCode.text.slice(
                arrowToken.range[1],
                node.range[1]
            )

            if (node.body.type === "BlockStatement") {
                return `function(${paramText})${bodyText}`
            }
            if (preText.includes("\n")) {
                return `function(${paramText}){return(${bodyText})}`
            }
            return `function(${paramText}){return ${bodyText}}`
        }
function toFunctionExpression ( node ) { const params = node . params const paramText = params . length ? sourceCode . text . slice ( params [ 0 ] . range [ 0 ] , params [ params . length - 1 ] . range [ 1 ] ) : "" const arrowToken = sourceCode . getTokenBefore ( node . body , isArrowToken ) const preText = sourceCode . text . slice ( arrowToken . range [ 1 ] , node . body . range [ 0 ] ) const bodyText = sourceCode . text . slice ( arrowToken . range [ 1 ] , node . range [ 1 ] ) if ( node . body . type === "BlockStatement" ) { return ` ${ paramText } ${ bodyText } ` } if ( preText . includes ( "\n" ) ) { return ` ${ paramText } ${ bodyText } ` } return ` ${ paramText } ${ bodyText } ` }
ArrowFunctionExpression to FunctionExpression
@param  {Node} node ArrowFunctionExpression Node
@returns {string} function expression text
ArrowFunctionExpression to FunctionExpression