feat: check errors in the configuration file (#720)

* feat: check errors in the configuration file

feat: added --lint-config option for lint command

chore: added few test

chore: added UT's for handle lint

chore: added UT's for handle lint

* fix: fixed conflicts

* chore: resolv conflicts

* chore: add e2e test for lint-config, update coverageThreshold

* fix: fixed typo

* chore: lint missed part of code

fix: fix path in shapshot e2e test

fix: fix path in shapshot e2e test

* chore: update branch and resolve conflicts

* chore: PR comments and lint fix

* fix: fix typo in tests

Co-authored-by: SmoliyY <yevhen.smoliy@gmail.com>
This commit is contained in:
Roman Sainchuk
2022-06-22 17:05:06 +03:00
committed by GitHub
parent 0bee06b111
commit 542b2b8fbf
37 changed files with 902 additions and 164 deletions

View File

@@ -230,6 +230,24 @@ export function printLintTotals(totals: Totals, definitionsCount: number) {
process.stderr.write('\n');
}
export function printConfigLintTotals(totals: Totals): void {
if (totals.errors > 0) {
process.stderr.write(
red(
`❌ Your config has ${totals.errors} ${pluralize('error', totals.errors)}${
totals.warnings > 0
? ` and ${totals.warnings} ${pluralize('warning', totals.warnings)}`
: ''
}.\n`,
),
);
} else if (totals.warnings > 0) {
process.stderr.write(
yellow(`You have ${totals.warnings} ${pluralize('warning', totals.warnings)}.\n`),
);
};
}
export function getOutputFileName(
entrypoint: string,
entries: number,
@@ -289,7 +307,7 @@ export function printUnusedWarnings(config: LintConfig) {
}
if (rules.length || preprocessors.length) {
process.stderr.write(`Check the spelling and verify you added plugin prefix.\n`);
process.stderr.write(`Check the spelling and verify the added plugin prefix.\n`);
}
}