Skip to content

Commit

Permalink
Add JSHint and JSCS to the build
Browse files Browse the repository at this point in the history
  • Loading branch information
tehapo committed Dec 10, 2015
1 parent 8d53b4c commit 941a3fa
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"preset": "google",
"maximumLineLength": 180,
"disallowMultipleVarDecl": false,
"validateIndentation": false,
"disallowTrailingWhitespace": false,
"jsDoc": {
"checkAnnotations": {
"extra": {
"polymerBehavior": true,
"param": true,
"return": true,
"private": true,
"default": true,
"event": true,
"property": true,
"type": true,
"method": true
}
}
}
}
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"browser": true,
"node": true
"node": true,
"expr": true
}
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ language: java
install: travis_retry npm install
jdk: oraclejdk8
script:
- gulp lint:js
- gulp lint:html
- gulp clean
- gulp gwt:validate
- travis_retry gulp test:desktop
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"bower": "latest",
"fs-extra": "latest",
"del" : "latest",
"del": "latest",
"gulp": "latest",
"gulp-git": "latest",
"gulp-json-editor": "latest",
Expand All @@ -27,11 +27,15 @@
"gemini-sauce": "^0.9.1",
"gulp-bower": "0.0.10",
"gulp-download": "0.0.1",
"gulp-html-extract": "0.0.3",
"gulp-insert": "latest",
"gulp-jscs": "^3.0.2",
"gulp-jshint": "^2.0.0",
"gulp-rsync": "0.0.5",
"gulp-unzip": "^0.1.3",
"gulp-zip": "^2.0.3",
"hash-files": "^1.0.0",
"jshint": "^2.8.0",
"lodash": "^3.5.0",
"node-ssh-exec": "^0.1.1",
"require-dir": "^0.1.0",
Expand Down
38 changes: 38 additions & 0 deletions tasks/lint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var htmlExtract = require('gulp-html-extract');

gulp.task('lint:js', function() {
return gulp.src([
'*.js',
'!*.min.js',
'test/*.js',
'tasks/*.js'
])
.pipe(jshint())
.pipe(jshint.reporter())
.pipe(jshint.reporter('fail'))
.pipe(jscs())
.pipe(jscs.reporter())
.pipe(jscs.reporter('fail'));
});

gulp.task('lint:html', function() {
return gulp.src([
'*.html',
'demo/*.html',
'!demo/angular2.html',
'!demo/react.html',
'test/*.html'
])
.pipe(htmlExtract({
sel: 'script, code-example code'
}))
.pipe(jshint())
.pipe(jshint.reporter())
.pipe(jshint.reporter('fail'))
.pipe(jscs())
.pipe(jscs.reporter())
.pipe(jscs.reporter('fail'));
});

0 comments on commit 941a3fa

Please sign in to comment.