Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ignoreStylelintIgnoreWarnings = lintResults =>
formatters.string(
lintResults.reduce((memo, result) => {
const { warnings } = result;
const fileIsIgnored = warnings.some(warning =>
RegExp(IGNORE_STRING, "i").test(warning.text)
);
if (!fileIsIgnored) {
memo.push(result);
}
return memo;
}, [])
);
try {
lintingOutcome = await lint({
configFile: join(systemRoot, options.stylelintConfig),
files,
});
if (lintingOutcome.errored) {
context.logger.error(ERROR_MESSAGE);
} else {
context.logger.info(SUCCESS_MESSAGE);
}
const errors = lintingOutcome.results.filter(result => result.errored);
if (errors.length) {
context.logger.info(formatters.string(errors));
}
if (options.reportFile) {
await junitFormatter(options.reportFile, lintingOutcome.results);
}
} catch (error) {
context.logger.error(error.message);
}
return {
success: (lintingOutcome && !lintingOutcome.errored) || false,
};
}
.forEach(x => logger.info(formatters.string([x])));
}