custom-tslint-formatters
Advanced tools
Comparing version
@@ -14,4 +14,4 @@ "use strict"; | ||
var Lint = require("tslint"); | ||
var chalk = require("chalk"); | ||
var Formatter = (function (_super) { | ||
var chalk_1 = require("chalk"); | ||
var Formatter = /** @class */ (function (_super) { | ||
__extends(Formatter, _super); | ||
@@ -26,3 +26,5 @@ function Formatter() { | ||
var ruleName = failure.getRuleName(); | ||
return " " + chalk.dim(position) + " " + message + " " + chalk.dim(ruleName); | ||
var severity = failure.getRuleSeverity(); | ||
var positionColor = severity === 'warning' ? chalk_1.default.yellow : chalk_1.default.red; | ||
return " " + positionColor(position) + " " + message + " " + chalk_1.default.dim(ruleName); | ||
}; | ||
@@ -42,3 +44,3 @@ Formatter.prototype.groupByFile = function (failures) { | ||
.reduce(function (lines, fileName) { | ||
lines.push(chalk.underline.yellow(fileName)); | ||
lines.push(chalk_1.default.underline.green(fileName)); | ||
var fileFailures = failuresByFile[fileName]; | ||
@@ -45,0 +47,0 @@ return lines.concat(fileFailures.map(_this.formatFailure), ['\n']); |
@@ -15,3 +15,3 @@ "use strict"; | ||
var Lint = require("tslint"); | ||
var Formatter = (function (_super) { | ||
var Formatter = /** @class */ (function (_super) { | ||
__extends(Formatter, _super); | ||
@@ -18,0 +18,0 @@ function Formatter() { |
{ | ||
"name": "custom-tslint-formatters", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Custom formatters for TSLint.", | ||
@@ -34,11 +34,10 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@types/chalk": "^0.4.31", | ||
"@types/node": "^7.0.12", | ||
"lint-staged": "^4.0.2", | ||
"prettier": "^1.5.3", | ||
"tslint": "^5.0.0", | ||
"typescript": "^2.2.2" | ||
"@types/node": "^8.9.1", | ||
"lint-staged": "^6.1.0", | ||
"prettier": "^1.10.2", | ||
"tslint": "^5.9.1", | ||
"typescript": "^2.7.1" | ||
}, | ||
"dependencies": { | ||
"chalk": "^1.1.3" | ||
"chalk": "^2.3.0" | ||
}, | ||
@@ -45,0 +44,0 @@ "lint-staged": { |
@@ -13,4 +13,6 @@ Custom TSLint Formatters | ||
 | ||
<img width="603" alt="custom tslint formatter grouped" src="docs/screenshots/grouped.png"> | ||
Errors are printed with a red position (`row:column`), warnings are printed with a yellow position. | ||
### `vscode` | ||
@@ -17,0 +19,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5
-16.67%92
2.22%98
2.08%98962
-38.91%7
-12.5%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated