Skip to content

Commit

Permalink
Merge pull request #141 from marcusmolchany/eslint-task
Browse files Browse the repository at this point in the history
Add gulp eslint task
  • Loading branch information
jakemmarsh committed Mar 1, 2016
2 parents a46e1dd + 9b665b5 commit 07e64e6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"env" : {
"es6" : true
}
}
20 changes: 20 additions & 0 deletions gulp/tasks/eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

import config from '../config';
import gulp from 'gulp';
import eslint from 'gulp-eslint';

gulp.task('eslint', () => {
// Be sure to return the stream from the task;
// Otherwise, the task may end before the stream has finished.
return gulp.src([config.scripts.src, '!app/js/templates.js'])
// eslint() attaches the lint output to the "eslint" property
// of the file object so it can be used by other modules.
.pipe(eslint())
// eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failAfterError last.
.pipe(eslint.failAfterError());
});
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
"bulkify": "^1.1.1",
"debowerify": "^1.3.1",
"del": "^2.1.0",
"eslint": "^1.10.3",
"express": "^4.13.3",
"gulp": "^3.9.0",
"gulp-angular-templatecache": "^1.3.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-changed": "^1.0.0",
"gulp-eslint": "^1.1.1",
"gulp-gzip": "^1.2.0",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
Expand Down

0 comments on commit 07e64e6

Please sign in to comment.