Skip to content

Commit

Permalink
gulp-linting enabled, now it is much simpler to develop
Browse files Browse the repository at this point in the history
see route4me#16 - one step closer
  • Loading branch information
maxkoryukov committed Jan 25, 2017
1 parent 79b6d16 commit e030604
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 9 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
"use strict"

const argv = require('yargs').argv;
const argv = require("yargs").argv

const gulp = require("gulp")
const eslint = require('gulp-eslint')
const gulpIf = require("gulp-if")
const eslint = require("gulp-eslint")

gulp.task('default', ['lint'])
gulp.task("default", ["lint"])

gulp.task('lint', () => {
return gulp.src(['gulpfile.js', '**/.js'])
gulp.task("lint", () => {
const fix = !!argv.fix
return gulp.src(["gulpfile.js", "**/.js"])
.pipe(eslint({
"fix": !!argv.fix
fix,
}))
.pipe(gulp.dest())
.pipe(eslint.format())
.pipe(gulpIf(fix, gulp.dest("./")))
.pipe(eslint.failAfterError())
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "src/",
"scripts": {
"test": "`npm bin`/mocha",
"lint": "`npm bin`/eslint ./",
"lint": "`npm bin`/gulp lint",
"coverage": "`npm bin`/istanbul cover `npm bin`/_mocha -- --reporter min"
},
"repository": {
Expand Down Expand Up @@ -63,6 +63,7 @@
"eslint-plugin-react": "^6.9.0",
"gulp": "^3.9.1",
"gulp-eslint": "^3.0.1",
"gulp-if": "^2.0.2",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"sinon": "^1.17.7",
Expand Down

0 comments on commit e030604

Please sign in to comment.