grafana/toolkit: allow builds with lint warnings (#28810)

* grafana/toolkit: allow builds with lint warnings

* Remove redundant code
This commit is contained in:
Dominik Prokop 2020-11-04 13:51:23 +01:00 committed by GitHub
parent 4eeac69b29
commit 5916ef94d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,13 +103,16 @@ export const lintPlugin = ({ fix }: Fixable = {}) =>
}
const { errorCount, results, warningCount } = report;
const formatter = cli.getFormatter();
if (errorCount > 0 || warningCount > 0) {
const formatter = cli.getFormatter();
console.log('\n');
console.log(formatter(results));
console.log('\n');
throw new Error(`${errorCount + warningCount} linting errors found in ${results.length} files`);
}
if (errorCount > 0) {
throw new Error(`${errorCount} linting errors found in ${results.length} files`);
}
});