mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-07 04:21:11 +00:00
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:
@@ -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`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user