function checkDeclarationsInScope({ variables }, name) {
      variables
        .filter((variable) => variable.name === name)
        .forEach((variable) => {
          variable.defs
            .filter((def) => def.type === 'Variable' && def.parent)
            .forEach((def) => {
              checkDeclaration(def.parent);
            });
        });
    }
@type {(scope: import('eslint').Scope.Scope, name: string) => void}