Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try {
ruleUrl = data.rulesMeta[x.ruleId].docs.url;
} catch (_) {
try {
ruleUrl = getRuleDocs(x.ruleId).url;
} catch (_) {}
}
const line = [
'',
x.severity === 'warning' ? logSymbols.warning : logSymbols.error,
' '.repeat(maxLineWidth - x.lineWidth) + chalk.dim(x.line + chalk.gray(':') + x.column),
' '.repeat(maxColumnWidth - x.columnWidth) + x.message,
' '.repeat(maxMessageWidth - x.messageWidth) +
(ruleUrl && supportsHyperlink(process.stdout) ? ansiEscapes.link(chalk.dim(x.ruleId), ruleUrl) : chalk.dim(x.ruleId))
];
if (!showLineNumbers) {
line.splice(2, 1);
}
return line.join(' ');
}
return '';
}).join('\n') + '\n\n';