1
- " use strict" ;
1
+ ' use strict' ;
2
2
3
- module . exports = function ( grunt ) {
3
+ module . exports = function ( grunt ) {
4
4
5
5
require ( 'load-grunt-tasks' ) ( grunt ) ;
6
6
var browser = process . env . BROWSER ;
7
7
var travisBuild = process . env . BUILD ;
8
8
var pullRequest = process . env . TRAVIS_PULL_REQUEST ;
9
9
10
10
grunt . initConfig ( {
11
+ eslint : {
12
+ target : [ 'Gruntfile.js' , 'Specs/**/*.js' , 'Source/**/*.js' ] ,
13
+ options : {
14
+ rulePaths : [ 'Tests/eslint/rules' ]
15
+ }
16
+ } ,
17
+
11
18
'connect' : {
12
19
testserver : {
13
20
options : {
@@ -16,11 +23,11 @@ module.exports = function(grunt) {
16
23
// to avoid https://github.com/joyent/libuv/issues/826
17
24
port : 8000 ,
18
25
hostname : '0.0.0.0' ,
19
- middleware : function ( connect , options ) {
26
+ middleware : function ( connect , options ) {
20
27
return [
21
- function ( req , resp , next ) {
28
+ function ( req , resp , next ) {
22
29
// cache get requests to speed up tests on travis
23
- if ( req . method === 'GET' ) {
30
+ if ( req . method === 'GET' ) {
24
31
resp . setHeader ( 'Cache-control' , 'public, max-age=3600' ) ;
25
32
}
26
33
@@ -37,7 +44,7 @@ module.exports = function(grunt) {
37
44
38
45
options : {
39
46
name : {
40
- More : 'Source/' ,
47
+ More : 'Source/' ,
41
48
Core : 'node_modules/mootools-core/'
42
49
}
43
50
} ,
@@ -86,8 +93,8 @@ module.exports = function(grunt) {
86
93
singleRun : true ,
87
94
frameworks : [ 'jasmine' , 'sinon' ] ,
88
95
files : [
89
- 'Tests/Utilities/*.js' ,
90
- 'mootools-*.js' ,
96
+ 'Tests/Utilities/*.js' ,
97
+ 'mootools-*.js' ,
91
98
{ pattern : 'Tests/Specs/assets/*.*' , included : false , served : true }
92
99
] ,
93
100
sauceLabs : {
@@ -194,7 +201,7 @@ module.exports = function(grunt) {
194
201
version : '6' ,
195
202
deviceOrientation : 'portrait'
196
203
}
197
- } ,
204
+ }
198
205
} ,
199
206
200
207
continuous : {
@@ -221,8 +228,8 @@ module.exports = function(grunt) {
221
228
222
229
} ) ;
223
230
224
- var compatBuild = [ 'clean' , 'packager:all' , 'packager:specs' ] ;
225
- var nocompatBuild = [ 'clean' , 'packager:morenocompat' , 'packager:specs-nocompat' ] ;
231
+ var compatBuild = [ 'clean' , 'eslint' , ' packager:all', 'packager:specs' ] ;
232
+ var nocompatBuild = [ 'clean' , 'eslint' , ' packager:morenocompat', 'packager:specs-nocompat' ] ;
226
233
227
234
var tasks = travisBuild == 'default' ? compatBuild : nocompatBuild ;
228
235
tasks = pullRequest != 'false' ? tasks . concat ( 'karma:continuous' ) : tasks . concat ( 'karma:sauceTask' ) ;
0 commit comments