Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
HAWKULAR-12: adding tslint to the console build
Browse files Browse the repository at this point in the history
  • Loading branch information
Viliam Rockai committed Jan 29, 2015
1 parent fed2a5a commit 6b3a2fa
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 3 deletions.
21 changes: 18 additions & 3 deletions ui/console/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var gulp = require('gulp'),
fs = require('fs'),
path = require('path'),
s = require('underscore.string');
tslint = require('gulp-tslint');

var plugins = gulpLoadPlugins({});
var pkg = require('./package.json');
Expand Down Expand Up @@ -73,6 +74,20 @@ gulp.task('tsc', ['clean-defs'], function() {
}));
});

gulp.task('tslint', function(){
gulp.src(config.ts)
.pipe(tslint())
.pipe(tslint.report('verbose'));
});

gulp.task('tslint-watch', function(){
gulp.src(config.ts)
.pipe(tslint())
.pipe(tslint.report('prose', {
emitError: false
}));
});

gulp.task('template', ['tsc'], function() {
return gulp.src(config.templates)
.pipe(plugins.angularTemplatecache({
Expand Down Expand Up @@ -101,7 +116,7 @@ gulp.task('watch', ['build'], function() {
gulp.start('reload');
});
plugins.watch(['libs/**/*.d.ts', config.ts, config.templates], function() {
gulp.start(['tsc', 'template', 'concat', 'clean']);
gulp.start(['tslint-watch', 'tsc', 'template', 'concat', 'clean']);
});
});

Expand All @@ -119,9 +134,9 @@ gulp.task('reload', function() {
.pipe(plugins.connect.reload());
});

gulp.task('build', ['bower', 'path-adjust', 'tsc', 'template', 'concat', 'clean']);
gulp.task('build', ['bower', 'path-adjust', 'tslint', 'tsc', 'template', 'concat', 'clean']);

gulp.task('default', ['connect']);



1 change: 1 addition & 0 deletions ui/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"gulp-connect": "^2.2.0",
"gulp-load-plugins": "^0.8.0",
"gulp-notify": "^2.1.0",
"gulp-tslint": "^1.4.2",
"gulp-typescript": "^2.3.0",
"gulp-watch": "^3.0.0",
"through2": "^0.6.3",
Expand Down
53 changes: 53 additions & 0 deletions ui/console/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"rules": {
"class-name": true,
"curly": true,
"eofline": true,
"forin": true,
"indent": [true, "spaces"],
"label-position": true,
"label-undefined": true,
"_max-line-length": [true, 140],
"no-arg": true,
"no-bitwise": true,
"no-console": [true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-string-literal": true,
"no-switch-case-fall-through": true,
"no-trailing-comma": true,
"_no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": false,
"no-unreachable": true,
"no-use-before-declare": true,
"one-line": [true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"_quotemark": [true, "double"],
"radix": true,
"semicolon": true,
"triple-equals": [true, "allow-null-check"],
"variable-name": false,
"whitespace": [true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"_check-type"
]
}
}

0 comments on commit 6b3a2fa

Please sign in to comment.