async function printResults(engine, results, format, outputFile, resultsMeta) {
	let formatter;

	try {
		formatter = await engine.loadFormatter(format);
	} catch (e) {
		log.error(e.message);
		return false;
	}

	const output = await formatter.format(results, resultsMeta);

	if (outputFile) {
		const filePath = path.resolve(process.cwd(), outputFile);

		if (await isDirectory(filePath)) {
			log.error(
				"Cannot write to output file path, it is a directory: %s",
				outputFile,
			);
			return false;
		}

		try {
			await mkdir(path.dirname(filePath), { recursive: true });
			await writeFile(filePath, output);
		} catch (ex) {
			log.error("There was a problem writing the output file:\n%s", ex);
			return false;
		}
	} else if (output) {
		log.info(output);
	}

	return true;
}
Outputs the results of the linting.
@param {ESLint} engine The ESLint instance to use.
@param {LintResult[]} results The results to print.
@param {string} format The name of the formatter to use or the path to the formatter.
@param {string} outputFile The path for the output file.
@param {ResultsMeta} resultsMeta Warning count and max threshold.
@returns {Promise<boolean>} True if the printing succeeds, false if not.
@private