lib/rules/array-type.js
function typeNeedsParentheses(node) {
    if (node.type === "TSTypeReference") {
        switch (node.typeName.type) {
            case "TSUnionType":
            case "TSFunctionType":
            case "TSIntersectionType":
            case "TSTypeOperator":
                return true;
            default:
                return false;
        }
    }
    return false;
}
function typeNeedsParentheses(node) {
    if (node.type === "TSTypeReference") {
        switch (node.typeName.type) {
            case "TSUnionType":
            case "TSFunctionType":
            case "TSIntersectionType":
            case "TSTypeOperator":
                return true;
            default:
                return false;
        }
    }
    return false;
}
function typeNeedsParentheses ( node ) { if ( node . type === "TSTypeReference" ) { switch ( node . typeName . type ) { case "TSUnionType" : case "TSFunctionType" : case "TSIntersectionType" : case "TSTypeOperator" : return true ; default : return false ; } } return false ; }
Check if node needs parentheses
@param {ASTNode} node the node to be evaluated.
@returns {*} true or false
Check if node needs parentheses