getFormatter(format) {
		// default is stylish
		const resolvedFormatName = format || "stylish";

		// only strings are valid formatters
		if (typeof resolvedFormatName === "string") {
			// replace \ with / for Windows compatibility
			const normalizedFormatName = resolvedFormatName.replace(
				/\\/gu,
				"/",
			);

			const slots = internalSlotsMap.get(this);
			const cwd = slots ? slots.options.cwd : process.cwd();
			const namespace = naming.getNamespaceFromTerm(normalizedFormatName);

			let formatterPath;

			// if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages)
			if (!namespace && normalizedFormatName.includes("/")) {
				formatterPath = path.resolve(cwd, normalizedFormatName);
			} else {
				try {
					const npmFormat = naming.normalizePackageName(
						normalizedFormatName,
						"eslint-formatter",
					);

					formatterPath = ModuleResolver.resolve(
						npmFormat,
						path.join(cwd, "__placeholder__.js"),
					);
				} catch {
					formatterPath = path.resolve(
						__dirname,
						"formatters",
						normalizedFormatName,
					);
				}
			}

			try {
				return require(formatterPath);
			} catch (ex) {
				if (removedFormatters.has(format)) {
					ex.message = `The ${format} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${format}\``;
				} else {
					ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`;
				}
				throw ex;
			}
		} else {
			return null;
		}
	}
Returns the formatter representing the given format or null if the `format` is not a string.
@param {string} [format] The name of the format to load or the path to a
     custom formatter.
@throws {any} As may be thrown by requiring of formatter
@returns {(FormatterFunction|null)} The formatter function or null if the `format` is not a string.