From f3c4bb1cd66fa4137bc5f4b2aaa394f4aad21146 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Fri, 5 Feb 2016 12:08:01 -0800 Subject: [PATCH] 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 --- .eslintignore | 5 +++++ .eslintrc | 4 ++++ gulpfile.js | 5 +++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..552fce7fbf --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +node_modules/* +bower_components/* +test/* +src/**/demo/* +src/**/experimental/* diff --git a/.eslintrc b/.eslintrc index d959af7b16..873b5c969e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,9 @@ { "extends": "eslint:recommended", + "rules": { + "no-cond-assign": [2, "except-parens"], + "no-console": 0 + }, "env": { "browser": true }, diff --git a/gulpfile.js b/gulpfile.js index c9165940c2..b3e0227942 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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()); });