lib/rules/semi.js
function isOneLinerBlock(node) {
            const parent = node.parent;
            const nextToken = sourceCode.getTokenAfter(node);

            if (!nextToken || nextToken.value !== "}") {
                return false;
            }
            return (
                !!parent &&
                parent.type === "BlockStatement" &&
                parent.loc.start.line === parent.loc.end.line
            );
        }
function isOneLinerBlock(node) {
            const parent = node.parent;
            const nextToken = sourceCode.getTokenAfter(node);

            if (!nextToken || nextToken.value !== "}") {
                return false;
            }
            return (
                !!parent &&
                parent.type === "BlockStatement" &&
                parent.loc.start.line === parent.loc.end.line
            );
        }
function isOneLinerBlock ( node ) { const parent = node . parent ; const nextToken = sourceCode . getTokenAfter ( node ) ; if ( ! nextToken || nextToken . value !== "}" ) { return false ; } return ( ! ! parent && parent . type === "BlockStatement" && parent . loc . start . line === parent . loc . end . line ) ; }
Checks a node to see if it's in a one-liner block statement.
@param {ASTNode} node The node to check.
@returns {boolean} whether the node is in a one-liner block statement.
Checks a node to see if it s in a one - liner block statement .