Use ESLint for Polymer

Modified version of #2600

- Ignores experimental and demo folders
- A few style tweaks
- Rename gulp task to `gulp lint`, and cause it to emit non-zero status
  for travis testing

Thanks to @fredj for the base PR
This commit is contained in:
Daniel Freedman 2016-02-05 12:08:01 -08:00
parent d6e7033ac0
commit f3c4bb1cd6
3 changed files with 12 additions and 2 deletions

5
.eslintignore Normal file
View File

@ -0,0 +1,5 @@
node_modules/*
bower_components/*
test/*
src/**/demo/*
src/**/experimental/*

View File

@ -1,5 +1,9 @@
{
"extends": "eslint:recommended",
"rules": {
"no-cond-assign": [2, "except-parens"],
"no-console": 0
},
"env": {
"browser": true
},

View File

@ -126,8 +126,9 @@ gulp.task('release', function(cb) {
runseq('default', ['copy-bower-json', 'audit'], cb);
});
gulp.task('eslint', function() {
gulp.task('lint', function() {
return gulp.src('src/**/*.html')
.pipe(eslint())
.pipe(eslint.format());
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});