lib/rules/no-extra-parens.js
function requiresTrailingSpace(node) {
            const nextTwoTokens = sourceCode.getTokensAfter(node, { count: 2 });
            const rightParenToken = nextTwoTokens[0];
            const tokenAfterRightParen = nextTwoTokens[1];
            const tokenBeforeRightParen = sourceCode.getLastToken(node);

            return rightParenToken && tokenAfterRightParen &&
                !sourceCode.isSpaceBetweenTokens(rightParenToken, tokenAfterRightParen) &&
                !astUtils.canTokensBeAdjacent(tokenBeforeRightParen, tokenAfterRightParen);
        }
function requiresTrailingSpace(node) {
            const nextTwoTokens = sourceCode.getTokensAfter(node, { count: 2 });
            const rightParenToken = nextTwoTokens[0];
            const tokenAfterRightParen = nextTwoTokens[1];
            const tokenBeforeRightParen = sourceCode.getLastToken(node);

            return rightParenToken && tokenAfterRightParen &&
                !sourceCode.isSpaceBetweenTokens(rightParenToken, tokenAfterRightParen) &&
                !astUtils.canTokensBeAdjacent(tokenBeforeRightParen, tokenAfterRightParen);
        }
function requiresTrailingSpace ( node ) { const nextTwoTokens = sourceCode . getTokensAfter ( node , { count : 2 } ) ; const rightParenToken = nextTwoTokens [ 0 ] ; const tokenAfterRightParen = nextTwoTokens [ 1 ] ; const tokenBeforeRightParen = sourceCode . getLastToken ( node ) ; return rightParenToken && tokenAfterRightParen && ! sourceCode . isSpaceBetweenTokens ( rightParenToken , tokenAfterRightParen ) && ! astUtils . canTokensBeAdjacent ( tokenBeforeRightParen , tokenAfterRightParen ) ; }
Determines whether a node should be followed by an additional space when removing parens
@param {ASTNode} node node to evaluate; must be surrounded by parentheses
@returns {boolean} `true` if a space should be inserted after the node
@private
Determines whether a node should be followed by an additional space when removing parens