function isConcat(node, sepNodes, globalScope) {
    const parent = node.parent
    const nextChars = []

    if (
        parent.type === "BinaryExpression" &&
        parent.operator === "+" &&
        parent.left === node
    ) {
        collectFirstChars(
            parent.right,
            sepNodes,
            globalScope,
            /* out */ nextChars
        )
    } else if (parent.type === "TemplateLiteral") {
        collectFirstCharsOfTemplateElement(
            parent,
            parent.expressions.indexOf(node) + 1,
            sepNodes,
            globalScope,
            /* out */ nextChars
        )
    }

    return nextChars.some(isPathSeparator)
}
Check if the given Identifier node is followed by string concatenation with a
path separator.
@param {Identifier} node The `__dirname` or `__filename` node to check.
@param {Set<Node>} sepNodes The nodes of `path.sep`.
@param {import("escope").Scope} globalScope The global scope object.
@returns {boolean} `true` if the given Identifier node is followed by string
concatenation with a path separator.