function check(node) {
			const parent = node.parent;

			if (
				parent.type === "BlockStatement" &&
				validBlockStatementParent.has(parent.parent.type)
			) {
				return;
			}

			if (validParent.has(parent.type)) {
				return;
			}

			context.report({
				node,
				messageId: "moveDeclToRoot",
				data: {
					type:
						node.type === "FunctionDeclaration"
							? "function"
							: "variable",
					body: getAllowedBodyDescription(node),
				},
			});
		}
Ensure that a given node is at a program or function body's root.
@param {ASTNode} node Declaration node to check.
@returns {void}