function checkImports(imported, context) {
  for (const [module, nodes] of imported.entries()) {
    if (nodes.length > 1) {
      const message = `'${module}' imported multiple times.`;
      const [first, ...rest] = nodes;
      const sourceCode = getSourceCode(context);
      const fix = getFix(first, rest, sourceCode, context);

      context.report({
        node: first.source,
        message,
        fix, // Attach the autofix (if any) to the first import.
      });

      rest.forEach((node) => {
        context.report({
          node: node.source,
          message,
        });
      });
    }
  }
}
@type {(imported: Map<string, import('estree').ImportDeclaration[]>, context: import('eslint').Rule.RuleContext) => void}