-
Notifications
You must be signed in to change notification settings - Fork 10
Fixes Issue #1: Re-enables JS linting #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ var rename = require('gulp-rename'); | |
var path = require('path'); | ||
var plumber = require('gulp-plumber'); | ||
var runSequence = require('run-sequence'); | ||
var jshint = require('gulp-jshint'); | ||
var eslint = require('gulp-eslint'); | ||
|
||
/** | ||
* File patterns | ||
|
@@ -31,7 +31,7 @@ var lintFiles = [ | |
'gulpfile.js', | ||
// Karma configuration | ||
'karma-*.conf.js' | ||
]; // .concat(sourceFiles); | ||
].concat(sourceFiles); | ||
|
||
gulp.task('build', function() { | ||
gulp.src(sourceFiles) | ||
|
@@ -47,7 +47,7 @@ gulp.task('build', function() { | |
* Process | ||
*/ | ||
gulp.task('process-all', function (done) { | ||
runSequence('jshint', 'test-src', 'build', done); | ||
runSequence('lint', 'test-src', 'build', done); | ||
}); | ||
|
||
/** | ||
|
@@ -62,12 +62,23 @@ gulp.task('watch', function () { | |
/** | ||
* Validate source JavaScript | ||
*/ | ||
gulp.task('jshint', function () { | ||
gulp.task('lint', function () { | ||
return gulp.src(lintFiles) | ||
.pipe(plumber()) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('jshint-stylish')) | ||
.pipe(jshint.reporter('fail')); | ||
.pipe(eslint({ | ||
extends: 'eslint:recommended', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just inlined the configuration options here, but I saw that crosslead-platform has a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, that we can spread our linting gospel to the masses. |
||
globals: { | ||
angular: true, | ||
module: true, | ||
require: true, | ||
__dirname: true, | ||
document: true | ||
} | ||
})) | ||
// Outputs the results to the console | ||
.pipe(eslint.format()) | ||
// Exits the process with exit-code(1) if there were errors | ||
.pipe(eslint.failAfterError()); | ||
}); | ||
|
||
/** | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When linting, the user shouldn't know what linter they are using. Instead, they should just invoke the command, and resolve conflicts.