diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000000..d959af7b16 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,14 @@ +{ + "extends": "eslint:recommended", + "env": { + "browser": true + }, + "plugins": [ + "html" + ], + "globals": { + "CustomElements": true, + "HTMLImports": true, + "Polymer": true + } +} diff --git a/gulpfile.js b/gulpfile.js index c201c2c3ac..c9165940c2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,6 +20,7 @@ var runseq = require('run-sequence'); var lazypipe = require('lazypipe'); var polyclean = require('polyclean'); var del = require('del'); +var eslint = require('gulp-eslint'); var path = require('path'); @@ -124,3 +125,9 @@ gulp.task('audit', function() { gulp.task('release', function(cb) { runseq('default', ['copy-bower-json', 'audit'], cb); }); + +gulp.task('eslint', function() { + return gulp.src('src/**/*.html') + .pipe(eslint()) + .pipe(eslint.format()); +}); diff --git a/package.json b/package.json index a086fad626..9ce05ebc5b 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,10 @@ }, "devDependencies": { "del": "^1.1.1", + "eslint-plugin-html": "^1.3.0", "gulp": "^3.8.11", "gulp-audit": "^1.0.0", + "gulp-eslint": "^1.1.1", "gulp-rename": "^1.2.2", "gulp-replace": "^0.5.3", "gulp-vulcanize": "^6.0.1",