Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 870dd34

Browse files
committed
add jscs styling to grunt, move back jshint config to grunt
1 parent cec0397 commit 870dd34

File tree

4 files changed

+93
-80
lines changed

4 files changed

+93
-80
lines changed

.jscsrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"requireImportAlphabetized": true,
2828
"requireLineBreakAfterVariableAssignment": true,
2929
"requireLineFeedAtFileEnd": true,
30-
"requireMultiLineTernary": true,
30+
"requireMultiLineTernary": false,
3131
"requireObjectKeysOnNewLine": true,
3232
"requirePaddingNewLinesAfterUseStrict": true,
3333
"requirePaddingNewLinesInObjects": true,

.jshintrc

Lines changed: 0 additions & 20 deletions
This file was deleted.

gruntFile.js

Lines changed: 91 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,91 @@
1-
module.exports = function (grunt) {
2-
"use strict";
3-
4-
// load all grunt tasks
5-
require('load-grunt-tasks')(grunt);
6-
7-
// Default task.
8-
grunt.registerTask('default', ['jshint', 'karma']);
9-
10-
// uglify
11-
grunt.registerTask('minify', ['uglify']);
12-
13-
//connect - local server
14-
grunt.registerTask('serve', ['connect']);
15-
16-
var testConfig = function (configFile, customOptions) {
17-
var options = {
18-
configFile : configFile,
19-
keepalive : true
20-
};
21-
var travisOptions = process.env.TRAVIS && {
22-
browsers : ['Firefox'],
23-
reporters : 'dots'
24-
};
25-
return grunt.util._.extend(options, customOptions, travisOptions);
26-
};
27-
28-
// Project configuration.
29-
grunt.initConfig({
30-
karma : {
31-
unit : {
32-
options : testConfig('test/test.conf.js')
33-
}
34-
},
35-
jshint : {
36-
files : ['src/**/*.js', 'test/**/*.js', 'demo/**/*.js'],
37-
jshintrc : true
38-
},
39-
uglify : {
40-
build : {
41-
src : ['src/**/*.js'],
42-
dest : 'calendar.min.js'
43-
}
44-
},
45-
connect : {
46-
server : {
47-
options : {
48-
port : 8000,
49-
open : true,
50-
debug : true,
51-
keepalive : true,
52-
hostname : '*',
53-
base : ['demo', '.']
54-
}
55-
}
56-
}
57-
});
58-
59-
};
1+
module.exports = function (grunt) {
2+
"use strict";
3+
4+
// load all grunt tasks
5+
require('load-grunt-tasks')(grunt);
6+
7+
// Default task.
8+
grunt.registerTask('default', ['jshint', 'jscs', 'karma']);
9+
10+
// uglify
11+
grunt.registerTask('minify', ['uglify']);
12+
13+
//connect - local server
14+
grunt.registerTask('serve', ['connect']);
15+
16+
var testConfig = function (configFile, customOptions) {
17+
var options = {
18+
configFile : configFile,
19+
keepalive : true
20+
};
21+
var travisOptions = process.env.TRAVIS && {
22+
browsers : ['Firefox'],
23+
reporters : 'dots'
24+
};
25+
return grunt.util._.extend(options, customOptions, travisOptions);
26+
};
27+
28+
// Project configuration.
29+
grunt.initConfig({
30+
karma : {
31+
unit : {
32+
options : testConfig('test/test.conf.js')
33+
}
34+
},
35+
jshint : {
36+
files : ['src/**/*.js'],
37+
options : {
38+
curly : true,
39+
devel : true,
40+
eqeqeq : true,
41+
forin : true,
42+
funcscope : true,
43+
latedef : "nofunc",
44+
laxbreak : true,
45+
loopfunc : true,
46+
maxdepth : 3,
47+
noarg : true,
48+
nonbsp : true,
49+
nonew : true,
50+
notypeof : true,
51+
shadow : false,
52+
browser : true,
53+
undef : true,
54+
unused : "vars",
55+
predef : [],
56+
globals : {
57+
moment : true,
58+
angular : true,
59+
$ : true,
60+
jasmine : true
61+
}
62+
}
63+
},
64+
jscs : {
65+
all : [
66+
['src/**/*.js']
67+
],
68+
options : {
69+
config : '.jscsrc'
70+
}
71+
},
72+
uglify : {
73+
build : {
74+
src : ['src/**/*.js'],
75+
dest : 'calendar.min.js'
76+
}
77+
},
78+
connect : {
79+
server : {
80+
options : {
81+
port : 8000,
82+
open : true,
83+
debug : true,
84+
keepalive : true,
85+
hostname : '*',
86+
base : ['demo', '.']
87+
}
88+
}
89+
}
90+
});
91+
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"grunt-contrib-connect": "^0.10.1",
1313
"grunt-contrib-jshint": "^0.11.2",
1414
"grunt-contrib-uglify": "^0.9.1",
15+
"grunt-jscs": "^2.8.0",
1516
"grunt-karma": "^0.11.1",
1617
"jasmine-core": "^2.3.4",
1718
"karma": "^0.12.37",

0 commit comments

Comments
 (0)