async function loadPlugins(importer, pluginNames) {
	const plugins = {};

	await Promise.all(
		pluginNames.map(async pluginName => {
			const longName = normalizePackageName(pluginName, "eslint-plugin");
			const module = await importer.import(longName);

			if (!("default" in module)) {
				throw new Error(
					`"${longName}" cannot be used with the \`--plugin\` option because its default module does not provide a \`default\` export`,
				);
			}

			const shortName = getShorthandName(pluginName, "eslint-plugin");

			plugins[shortName] = module.default;
		}),
	);

	return plugins;
}
Loads plugins with the specified names.
@param {{ "import": (name: string) => Promise<any> }} importer An object with an `import` method called once for each plugin.
@param {string[]} pluginNames The names of the plugins to be loaded, with or without the "eslint-plugin-" prefix.
@returns {Promise<Record<string, Plugin>>} A mapping of plugin short names to implementations.