Skip to content

Commit

Permalink
Release 8.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
panuhorsmalahti committed Apr 10, 2017
1 parent 5a16f03 commit 19726ad
Show file tree
Hide file tree
Showing 8 changed files with 547 additions and 512 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<a name="8.0.0"></a>
# 8.0.0 (2017-4-10)

- **breaking change**: Require tslint 5.x [pull #113](https://github.com/panuhorsmalahti/gulp-tslint/pull/113).

<a name="7.1.0"></a>
# 7.1.0 (2017-2-3)

Expand Down
11 changes: 3 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ var tslintPlugin = function (pluginOptions) {
});
};
tslintPlugin.report = function (options) {
// Notify the user that the old interface is used, this can be removed at some point
if (isString(options)) {
throw new Error("Deprecated interface used! See 6.0.0 changelog " +
"https://github.com/panuhorsmalahti/gulp-tslint/blob/master/CHANGELOG.md");
}
// Default options
if (!options) {
options = {};
Expand All @@ -138,15 +133,15 @@ tslintPlugin.report = function (options) {
if (file.tslint) {
// Version 5.0.0 of tslint no longer has a failureCount member
// It was renamed to errorCount. See tslint issue #2439
var errorCount = file.tslint.errorCount;
if (errorCount > 0) {
var failureCount = file.tslint.errorCount + file.tslint.warningCount;
if (failureCount > 0) {
errorFiles.push(file);
Array.prototype.push.apply(allFailures, file.tslint.failures);
if (options.reportLimit <= 0 || (options.reportLimit && options.reportLimit > totalReported)) {
if (file.tslint.output !== undefined) {
console.log(file.tslint.output);
}
totalReported += errorCount;
totalReported += failureCount;
if (options.reportLimit > 0 &&
options.reportLimit <= totalReported) {
log("More than " + options.reportLimit
Expand Down
12 changes: 3 additions & 9 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,6 @@ const tslintPlugin = <TslintPlugin> function(pluginOptions?: PluginOptions) {
};

tslintPlugin.report = function(options?: ReportOptions) {
// Notify the user that the old interface is used, this can be removed at some point
if (isString(options)) {
throw new Error("Deprecated interface used! See 6.0.0 changelog " +
"https://github.com/panuhorsmalahti/gulp-tslint/blob/master/CHANGELOG.md");
}

// Default options
if (!options) {
options = {};
Expand Down Expand Up @@ -202,17 +196,17 @@ tslintPlugin.report = function(options?: ReportOptions) {
if (file.tslint) {
// Version 5.0.0 of tslint no longer has a failureCount member
// It was renamed to errorCount. See tslint issue #2439
const errorCount = file.tslint.errorCount;
const failureCount = file.tslint.errorCount + file.tslint.warningCount;

if (errorCount > 0) {
if (failureCount > 0) {
errorFiles.push(file);
Array.prototype.push.apply(allFailures, file.tslint.failures);

if (options.reportLimit <= 0 || (options.reportLimit && options.reportLimit > totalReported)) {
if (file.tslint.output !== undefined) {
console.log(file.tslint.output);
}
totalReported += errorCount;
totalReported += failureCount;

if (options.reportLimit > 0 &&
options.reportLimit <= totalReported) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gulp-tslint",
"preferGlobal": false,
"version": "7.1.0",
"version": "8.0.0",
"author": "Panu Horsmalahti <panu.horsmalahti@iki.fi>",
"description": "TypeScript linter Gulp plugin",
"contributors": [
Expand Down Expand Up @@ -35,7 +35,7 @@
"devDependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.1",
"gulp-typescript": "^3.1.4",
"gulp-typescript": "^3.1.6",
"tslint": "^5",
"typescript": "^2"
},
Expand Down
7 changes: 0 additions & 7 deletions test/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ gulp.task("invalid-emit", function() {
}));
});

// Should throw an error about using a deprecated interface
gulp.task("invalid-emit-deprecated", function() {
return gulp.src(["invalid.ts", "invalid2.ts"])
.pipe(tslint())
.pipe(tslint.report("verbose"));
});

// Should emit the error using the prose formatter
gulp.task("invalid-emit-default-formatter", function() {
return gulp.src(["invalid.ts", "invalid2.ts"])
Expand Down
1 change: 1 addition & 0 deletions test/invalid.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
if(true){var a="foo";if(false){;}}//abc
var b = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1;
5 changes: 4 additions & 1 deletion test/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"forin": true,
"indent": [true, 4],
"label-position": true,
"max-line-length": [true, 140],
"max-line-length": {
"options": 140,
"severity": "warning"
},
"no-arg": true,
"no-bitwise": true,
"no-console": [true,
Expand Down

0 comments on commit 19726ad

Please sign in to comment.