Skip to content

Commit 2a2a031

Browse files
committed
Merge pull request #2 from CrossLead/reenable_jslint_on_src_files
Fixes Issue #1: Re-enables JS linting
2 parents dfee8b2 + 28b07e2 commit 2a2a031

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

gulpfile.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var rename = require('gulp-rename');
66
var path = require('path');
77
var plumber = require('gulp-plumber');
88
var runSequence = require('run-sequence');
9-
var jshint = require('gulp-jshint');
9+
var eslint = require('gulp-eslint');
1010

1111
/**
1212
* File patterns
@@ -31,7 +31,7 @@ var lintFiles = [
3131
'gulpfile.js',
3232
// Karma configuration
3333
'karma-*.conf.js'
34-
]; // .concat(sourceFiles);
34+
].concat(sourceFiles);
3535

3636
gulp.task('build', function() {
3737
gulp.src(sourceFiles)
@@ -47,7 +47,7 @@ gulp.task('build', function() {
4747
* Process
4848
*/
4949
gulp.task('process-all', function (done) {
50-
runSequence('jshint', 'test-src', 'build', done);
50+
runSequence('lint', 'test-src', 'build', done);
5151
});
5252

5353
/**
@@ -62,12 +62,23 @@ gulp.task('watch', function () {
6262
/**
6363
* Validate source JavaScript
6464
*/
65-
gulp.task('jshint', function () {
65+
gulp.task('lint', function () {
6666
return gulp.src(lintFiles)
6767
.pipe(plumber())
68-
.pipe(jshint())
69-
.pipe(jshint.reporter('jshint-stylish'))
70-
.pipe(jshint.reporter('fail'));
68+
.pipe(eslint({
69+
extends: 'eslint:recommended',
70+
globals: {
71+
angular: true,
72+
module: true,
73+
require: true,
74+
__dirname: true,
75+
document: true
76+
}
77+
}))
78+
// Outputs the results to the console
79+
.pipe(eslint.format())
80+
// Exits the process with exit-code(1) if there were errors
81+
.pipe(eslint.failAfterError());
7182
});
7283

7384
/**

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
"devDependencies": {
1010
"chai": "^1.9.1",
1111
"chai-jquery": "^1.2.3",
12+
"eslint": "^2.11.1",
13+
"eslint-config-standard": "^5.3.1",
14+
"eslint-plugin-promise": "^1.3.1",
15+
"eslint-plugin-standard": "^1.3.2",
1216
"gulp": "^3.8.7",
1317
"gulp-concat": "^2.3.4",
14-
"gulp-jshint": "^1.8.4",
18+
"gulp-eslint": "^2.0.0",
1519
"gulp-plumber": "^0.6.6",
1620
"gulp-rename": "^1.2.0",
1721
"gulp-uglify": "^0.3.1",
1822
"jasmine-core": "^2.3.4",
19-
"jshint-stylish": "^0.4.0",
2023
"karma": "^0.12.22",
2124
"karma-chai": "^0.1.0",
2225
"karma-chai-jquery": "^1.0.0",

src/angular-zendesk-widget/zendeskWidget.module.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
}
1111

1212
var window = $window;
13+
1314
// Following is essentially a copy paste of JS portion of the Zendesk embed code
1415
// with our settings subbed in. For more info, see:
1516
// https://support.zendesk.com/hc/en-us/articles/203908456-Using-Web-Widget-to-embed-customer-service-in-your-website
1617

17-
// Note that JSHint ignore is not working in latest release, so can't actually turn
18-
// on JSHint yet. See https://github.com/jshint/jshint/issues/2411
19-
/* jshint ignore:start */
18+
/*eslint-disable */
2019

2120
window.zEmbed || function(e, t) {
2221
var n, o, d, i, s, a = [],
@@ -35,7 +34,7 @@
3534
}, o.write('<body onload="document._l();">'), o.close()
3635
}("https://assets.zendesk.com/embeddable_framework/main.js", zendeskWidgetSettings.accountUrl);
3736

38-
/* jshint ignore:end */
37+
/*eslint-enable */
3938

4039
$window.zE(function() {
4140
zendeskWidgetSettings.beforePageLoad($window.zE);

0 commit comments

Comments
 (0)