lib/rules/indent-legacy.js
function filterOutSameLineVars(node) {
            return node.declarations.reduce((finalCollection, elem) => {
                const lastElem = finalCollection[finalCollection.length - 1];

                if ((elem.loc.start.line !== node.loc.start.line && !lastElem) ||
                    (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) {
                    finalCollection.push(elem);
                }

                return finalCollection;
            }, []);
        }
function filterOutSameLineVars(node) {
            return node.declarations.reduce((finalCollection, elem) => {
                const lastElem = finalCollection[finalCollection.length - 1];

                if ((elem.loc.start.line !== node.loc.start.line && !lastElem) ||
                    (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) {
                    finalCollection.push(elem);
                }

                return finalCollection;
            }, []);
        }
function filterOutSameLineVars ( node ) { return node . declarations . reduce ( ( finalCollection , elem ) => { const lastElem = finalCollection [ finalCollection . length - 1 ] ; if ( ( elem . loc . start . line !== node . loc . start . line && ! lastElem ) || ( lastElem && lastElem . loc . start . line !== elem . loc . start . line ) ) { finalCollection . push ( elem ) ; } return finalCollection ; } , [ ] ) ; }
Filter out the elements which are on the same line of each other or the node.
basically have only 1 elements from each line except the variable declaration line.
@param {ASTNode} node Variable declaration node
@returns {ASTNode[]} Filtered elements
Filter out the elements which are on the same line of each other or the node . basically have only 1 elements from each line except the variable declaration line .