-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from marcusmolchany/eslint-task
Add gulp eslint task
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"env" : { | ||
"es6" : true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters