Skip to content

Commit 4e670f7

Browse files
committed
[wip] Lint the javascript code with eslint
```gulp lint```
1 parent ce2c2ce commit 4e670f7

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

.eslintrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "eslint:recommended",
3+
"env": {
4+
"browser": true
5+
},
6+
"plugins": [
7+
"html"
8+
],
9+
"globals": {
10+
"CustomElements": true,
11+
"HTMLImports": true,
12+
"Polymer": true
13+
}
14+
}

gulpfile.js

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var runseq = require('run-sequence');
2020
var lazypipe = require('lazypipe');
2121
var polyclean = require('polyclean');
2222
var del = require('del');
23+
var eslint = require('gulp-eslint');
2324

2425
var path = require('path');
2526

@@ -122,3 +123,9 @@ gulp.task('audit', function() {
122123
gulp.task('release', function(cb) {
123124
runseq('default', ['copy-bower-json', 'audit'], cb);
124125
});
126+
127+
gulp.task('lint', function() {
128+
return gulp.src('src/**/*.html')
129+
.pipe(eslint())
130+
.pipe(eslint.format());
131+
});

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
},
1010
"devDependencies": {
1111
"del": "^1.1.1",
12+
"eslint-plugin-html": "^1.0.4",
1213
"gulp": "^3.8.11",
1314
"gulp-audit": "^1.0.0",
15+
"gulp-eslint": "^1.0.0",
1416
"gulp-rename": "^1.2.2",
1517
"gulp-replace": "^0.5.3",
1618
"gulp-vulcanize": "^6.0.1",

0 commit comments

Comments
 (0)