Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(function gotInput(answers) {
// Display detailed error reports
const ruleName = answers.rule;
if (answers.fix) {
const fixOptions = {
rules : [ruleName],
warnings: answers.fixWarnings
};
const fixedReport = fix(files, fixOptions, configuration);
const ruleResults = nibbler.getRuleResults(fixedReport, ruleName);
if (ruleResults.errorCount > 0 || ruleResults.warningCount > 0) {
const detailed = nibbler.getFormattedResults(ruleResults, fmt.detailed);
console.log(detailed);
} else {
console.log(chalk.green(`Fixes applied, ${ruleName} is now passing`));
}
} else {
const ruleResults = nibbler.getRuleResults(report, ruleName);
const detailed = nibbler.getFormattedResults(ruleResults, fmt.detailed);
console.log(detailed);
}
});