function isTopLevelExpressionStatement(node) {
	if (node.type !== "ExpressionStatement") {
		return false;
	}
	const parent = node.parent;

	return (
		parent.type === "Program" ||
		parent.type === "TSModuleBlock" ||
		(parent.type === "BlockStatement" && isFunction(parent.parent))
	);
}
Checks whether a node is an ExpressionStatement at the top level of a file, function body, or TypeScript module block.
A top-level ExpressionStatement node is a directive if it contains a single unparenthesized
string literal and if it occurs either as the first sibling or immediately after another
directive.
@param {ASTNode} node The node to check.
@returns {boolean} Whether or not the node is an ExpressionStatement at the top level of a
file, function body, or TypeScript module block.