async function exitWithSummary(summary) {
    const formatter = await new ESLint().loadFormatter();
    const formattedResults = await formatter.format(summary.results, {cwd: '', rulesMeta: {}});

    if (formattedResults) {
        console.log(formattedResults); // eslint-disable-line no-console
    }

    if (summary.ignoreAllFlagProvidedWithoutFixFlag) {
        console.warn( // eslint-disable-line no-console
            '--unsafe-ignore-all was provided without --fix; errors were not ignored'
        );
    }

    if (summary.errorCount > 0) {
        console.log( // eslint-disable-line no-console
            `\nNote: Since JSON doesn't support comments, use test/i18n-ignore.json to waive messages.\n\n`
        );
        process.exit(1);
    }

    process.exit(0);
}
Formats and logs the lint results. If there are any errors, the exit code will be 1
@param {LintSummary} summary