update eslint

This commit is contained in:
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] [{package,bower}.json]
indent_style = space indent_style = space
indent_size = 2 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([ return gulp.src([
'src/scripts/**/*.js' 'src/scripts/**/*.js'
]).pipe(reload({stream: true, once: true})) ]).pipe(reload({stream: true, once: true}))
.pipe($.eslint({fix: true}))
.pipe($.eslint.format()) .pipe($.eslint.format())
.pipe($.if(!browserSync.active, $.eslint.failAfterError())) .pipe($.if(!browserSync.active, $.eslint.failAfterError()))
.pipe(gulp.dest('src/scripts')); .pipe(gulp.dest('src/scripts'));

View file

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