Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit 1729db3

Browse files
committed
Merge pull request #990 from ilanbiala/eslint
Add ESLint Fixes #763
2 parents 27ce914 + d5cc4b7 commit 1729db3

4 files changed

Lines changed: 61 additions & 2 deletions

File tree

.eslintrc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
rules: {
3+
indent: [2, 2, {"SwitchCase": 1}],
4+
no-multi-spaces: 2,
5+
no-underscore-dangle: 0,
6+
no-use-before-define: [1, "nofunc"],
7+
no-unused-expressions: 0,
8+
no-empty-class: 0,
9+
object-curly-spacing: [2, "always"],
10+
quotes: [1, "single"],
11+
space-in-parens: [2, "never"]
12+
},
13+
env: {
14+
node: true
15+
},
16+
globals: {
17+
angular: true,
18+
$: true,
19+
jQuery: true,
20+
moment: true,
21+
window: true,
22+
document: true,
23+
Modernizr: true,
24+
__TESTING__: true,
25+
beforeEach: true,
26+
expect: true,
27+
describe: true,
28+
it: true,
29+
element: true,
30+
by: true,
31+
browser: true,
32+
inject: true,
33+
register: true,
34+
sinon: true,
35+
_: false
36+
}
37+
}

gruntfile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ module.exports = function (grunt) {
102102
}
103103
}
104104
},
105+
eslint: {
106+
options: {},
107+
target: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e)
108+
},
105109
csslint: {
106110
options: {
107111
csslintrc: '.csslintrc'
@@ -293,7 +297,7 @@ module.exports = function (grunt) {
293297
});
294298

295299
// Lint CSS and JavaScript files.
296-
grunt.registerTask('lint', ['sass', 'less', 'jshint', 'csslint']);
300+
grunt.registerTask('lint', ['sass', 'less', 'jshint', 'eslint', 'csslint']);
297301

298302
// Lint project files and minify them into two production files.
299303
grunt.registerTask('build', ['env:dev', 'lint', 'ngAnnotate', 'uglify', 'cssmin']);

gulpfile.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,22 @@ gulp.task('jshint', function () {
9696
.pipe(plugins.jshint.reporter('fail'));
9797
});
9898

99+
// ESLint JS linting task
100+
gulp.task('eslint', function () {
101+
var assets = _.union(
102+
defaultAssets.server.gulpConfig,
103+
defaultAssets.server.allJS,
104+
defaultAssets.client.js,
105+
testAssets.tests.server,
106+
testAssets.tests.client,
107+
testAssets.tests.e2e
108+
);
109+
110+
return gulp.src(assets)
111+
.pipe(plugins.eslint())
112+
.pipe(plugins.eslint.format());
113+
});
114+
99115
// JS minifying task
100116
gulp.task('uglify', function () {
101117
var assets = _.union(
@@ -243,7 +259,7 @@ gulp.task('protractor', ['webdriver_update'], function () {
243259

244260
// Lint CSS and JavaScript files.
245261
gulp.task('lint', function (done) {
246-
runSequence('less', 'sass', ['csslint', 'jshint'], done);
262+
runSequence('less', 'sass', ['csslint', 'eslint', 'jshint'], done);
247263
});
248264

249265
// Lint project files and minify them into two production files.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"grunt-contrib-uglify": "~0.9.1",
7676
"grunt-contrib-watch": "~0.6.1",
7777
"grunt-env": "~0.4.4",
78+
"grunt-eslint": "~17.3.1",
7879
"grunt-karma": "~0.11.2",
7980
"grunt-mocha-istanbul": "^2.4.0",
8081
"grunt-mocha-test": "~0.12.7",
@@ -89,6 +90,7 @@
8990
"gulp-concat": "^2.6.0",
9091
"gulp-csslint": "~0.1.5",
9192
"gulp-cssmin": "~0.1.7",
93+
"gulp-eslint": "~1.0.0",
9294
"gulp-jshint": "^1.11.2",
9395
"gulp-karma": "~0.0.4",
9496
"gulp-less": "^3.0.3",

0 commit comments

Comments
 (0)