From e65d7acb32b922153c651289dd343b28ce1698af Mon Sep 17 00:00:00 2001 From: Aiden Scandella Date: Sat, 16 Jul 2016 17:10:18 -0700 Subject: [PATCH 1/2] Add test-specific tslint Fixes #379 --- gulpfile.js | 21 +++++++++++++++------ package.json | 3 ++- test/tslint.json | 6 ++++++ 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 test/tslint.json diff --git a/gulpfile.js b/gulpfile.js index 2d85f1d8e85..8df1468ac1a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,7 +8,8 @@ var gulp = require('gulp'), filter = require('gulp-filter'), tag_version = require('gulp-tag-version'), inject = require('gulp-inject-string'), - trimlines = require('gulp-trimlines'); + trimlines = require('gulp-trimlines'), + merge = require('merge-stream'); var paths = { src_ts: "src/**/*.ts", @@ -23,7 +24,7 @@ function versionBump(importance) { .pipe(filter('package.json')) .pipe(tag_version()); } - + gulp.task('patch', function() { return versionBump('patch'); }) gulp.task('minor', function() { return versionBump('minor'); }) gulp.task('major', function() { return versionBump('major'); }) @@ -57,11 +58,19 @@ gulp.task('fix-whitespace', function() { }); gulp.task('tslint', ['fix-whitespace'], function() { - return gulp.src([paths.src_ts, paths.tests_ts]) + var tslintOptions = { + summarizeFailureOutput: true + }; + + var srcs = gulp.src(paths.src_ts) .pipe(tslint()) - .pipe(tslint.report('prose', { - summarizeFailureOutput: true - })); + .pipe(tslint.report('prose', tslintOptions)); + var tests = gulp.src(paths.tests_ts) + .pipe(tslint({ + configuration: 'test/tslint.json' + })) + .pipe(tslint.report('prose', tslintOptions)); + return merge(srcs, tests); }); gulp.task('compile', shell.task([ diff --git a/package.json b/package.json index f11e785f933..bc64a176ed6 100644 --- a/package.json +++ b/package.json @@ -172,9 +172,10 @@ "gulp-tslint": "^5.0.0", "gulp-typescript": "^2.13.4", "gulp-typings": "^2.0.0", + "merge-stream": "^1.0.0", "tslint": "^3.10.2", "typescript": "2.0.0", "typings": "^1.0.4", "vscode": "^0.11.13" } -} \ No newline at end of file +} diff --git a/test/tslint.json b/test/tslint.json new file mode 100644 index 00000000000..75efc86e4f7 --- /dev/null +++ b/test/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "no-unused-variable": false + } +} From e629f5ad579bc339386f57c7b47cdad1a1761afe Mon Sep 17 00:00:00 2001 From: Aiden Scandella Date: Sat, 16 Jul 2016 17:18:10 -0700 Subject: [PATCH 2/2] Enable newTestOnly as proof-of-concept --- test/mode/modeNormal.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mode/modeNormal.test.ts b/test/mode/modeNormal.test.ts index 210878aabf9..79de6d5ee67 100644 --- a/test/mode/modeNormal.test.ts +++ b/test/mode/modeNormal.test.ts @@ -10,7 +10,7 @@ suite("Mode Normal", () => { let { newTest, - // newTestOnly + newTestOnly } = getTestingFunctions(modeHandler); setup(async () => {