update eslint

master
MaysWind 2016-12-11 02:11:27 +08:00
parent 088fd42e78
commit 9f31ad65c6
4 changed files with 127 additions and 100 deletions

View File

@ -23,8 +23,3 @@ trim_trailing_whitespace = false
[{package,bower}.json]
indent_style = space
indent_size = 2
[gulpfile.js]
indent_style = space
indent_size = 2

31
.eslintrc.json Normal file
View File

@ -0,0 +1,31 @@
{
"env": {
"browser": true,
"node": true
},
"extends": [
"angular",
"eslint:recommended"
],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}

View File

@ -34,7 +34,6 @@ gulp.task('lint', function () {
return gulp.src([
'src/scripts/**/*.js'
]).pipe(reload({stream: true, once: true}))
.pipe($.eslint({fix: true}))
.pipe($.eslint.format())
.pipe($.if(!browserSync.active, $.eslint.failAfterError()))
.pipe(gulp.dest('src/scripts'));

View File

@ -6,6 +6,8 @@
"devDependencies": {
"browser-sync": "^2.18.2",
"del": "^2.2.2",
"eslint-config-angular": "^0.5.0",
"eslint-plugin-angular": "^1.4.1",
"gulp": "^3.9.1",
"gulp-angular-templatecache": "^2.0.0",
"gulp-autoprefixer": "^3.1.1",