Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (i === keys.length - 1) {
next = null;
} else {
next = keys[i + 1];
}
cells.push([
stripe(i, node.position),
stripe(i, key),
stripe(i, node.mode || node.type),
stripe(i, node.lift ? '-' : ' '),
stripe(i, describe(node)),
stripe(i, node.drop ? '-' : ' '),
stripe(i, describeNext(node.next, next))
]);
}
console.log(table(cells, {
border: getBorderCharacters('void'),
columnDefault: {
paddingLeft: 0,
paddingRight: 2
},
columns: {
4: {
width: 40,
wrapWord: true
}
},
drawHorizontalLine: no
}));
}
public makeTable(data: any[][], config?: TableConfig): string {
return table(data, config);
}
chalk.bold("Rule ID")
]);
messages.forEach(function(message: TextlintMessage) {
let messageType;
if ((message as any).fatal || message.severity === 2) {
messageType = chalk.red("error");
} else {
messageType = chalk.yellow("warning");
}
rows.push([message.line || 0, message.column || 0, messageType, message.message, message.ruleId || ""]);
});
return table(rows, {
columns: {
0: {
width: 8,
wrapWord: true
},
1: {
width: 8,
wrapWord: true
},
2: {
width: 8,
wrapWord: true
},
3: {
paddingRight: 5,
width: 50,
let result = "";
let errorCount = 0;
let warningCount = 0;
report.forEach(function(fileReport: any) {
errorCount += fileReport.errorCount;
warningCount += fileReport.warningCount;
});
if (errorCount || warningCount) {
result = drawReport(report);
}
result +=
"\n" +
table(
[
[chalk.red(pluralize("Error", errorCount, true))],
[chalk.yellow(pluralize("Warning", warningCount, true))]
],
{
columns: {
0: {
width: 110,
wrapWord: true
}
},
drawHorizontalLine: function() {
return true;
}
}
);