Skip to content

Commit f310476

Browse files
committed
setting up jshint and refactoring to defined style
1 parent a9c585e commit f310476

19 files changed

Lines changed: 3685 additions & 373 deletions

‎.jshintrc‎

Lines changed: 82 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,83 @@
11
{
2-
/* "asi": false,
3-
"bitwise": true,
4-
"boss": true, */
5-
"camelcase": false,
6-
/* "eqeqeq": true,
7-
"eqnull": true,
8-
"evil": true,
9-
"expr": true,
10-
"forin": true,
11-
"immed": true,
12-
"indent": 2,
13-
"latedef": false,
14-
"maxcomplexity": 6,
15-
"maxdepth": 4,
16-
"maxlen": 80,
17-
"maxparams": 4,
18-
"maxstatements": 300,
19-
"newcap": true,
20-
"noarg": true,
21-
"noempty": true,
22-
"nonew": true,
23-
"quotmark": true,
24-
*/
25-
"strict": false,
26-
"node": true,
27-
/*
28-
"trailing": true,
29-
"undef": true,
30-
"browser": true,
31-
"jquery": true, */
32-
"globals": {
33-
"require": false,
34-
/* jasmine */
35-
"after": false,
36-
"afterEach": false,
37-
"before": false,
38-
"beforeEach": false,
39-
"describe": false,
40-
"expect": false,
41-
"it": false
42-
}
43-
}
2+
/* enforcing */
3+
"bitwise": true,
4+
"camelcase": false,
5+
"curly": false,
6+
"eqeqeq": false,
7+
"es3": true,
8+
"forin": false, // jshint doesn't understand continue form of this :(
9+
"freeze": true,
10+
"immed": true,
11+
"indent": 4,
12+
"latedef": "nofunc",
13+
"newcap": false,
14+
"noarg": true,
15+
"noempty": false,
16+
"nonbsp": true,
17+
"nonew": true,
18+
"plusplus": false,
19+
"quotmark": "double",
20+
"undef": true,
21+
"unused": true,
22+
"strict": true,
23+
// "maxparams": 0,
24+
// "maxdepth": 0,
25+
// "maxstatements": 0,
26+
// "maxcomplexity": 0,
27+
// "maxlen": 0,
28+
29+
/* relaxing */
30+
"asi": false,
31+
"boss": false,
32+
// "debug": false,
33+
"eqnull": false,
34+
"esnext": false,
35+
"evil": false,
36+
"expr": false,
37+
"funcscope": false,
38+
"globalstrict": false,
39+
"iterator": false,
40+
"lastsemic": true,
41+
"laxbreak": false,
42+
"laxcomma": false,
43+
"loopfunc": false,
44+
// "maxerr": 50,
45+
"moz": false,
46+
"multistr": false,
47+
"notypeof": false,
48+
"proto": false,
49+
"scripturl": false,
50+
"shadow": false,
51+
"sub": false,
52+
"supernew": false,
53+
"noyield": false,
54+
55+
/* env */
56+
"browser": false, // inline global declarations preferred as needed to easily see node vs. browser issues
57+
"node": true,
58+
"jquery": false, // see browser note
59+
60+
"couch": false,
61+
"devel": false,
62+
"dojo": false,
63+
"mootools": false,
64+
"nonstandard": false,
65+
"phantom": false,
66+
"prototypejs": false,
67+
"rhino": false,
68+
"worker": false,
69+
"wsh": false,
70+
"yui": false,
71+
72+
/* globals */
73+
"globals": {
74+
// jasmine
75+
"after": false,
76+
"afterEach": false,
77+
"before": false,
78+
"beforeEach": false,
79+
"describe": false,
80+
"expect": false,
81+
"it": false
82+
}
83+
}

‎Gruntfile.js‎

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
1-
'use strict';
1+
"use strict";
22

33
module.exports = function(grunt) {
44
// configure grunt
55
grunt.initConfig({
6-
pkg: grunt.file.readJSON('package.json'),
6+
pkg: grunt.file.readJSON("package.json"),
77
jshint: {
88
files: [
9-
'**/*.js',
10-
'!node_modules/**/*',
11-
'!dist/**/*'
9+
"**/*.js",
10+
"!node_modules/**/*",
11+
"!libs/**/*",
12+
"!dist/**/*"
1213
],
1314
options: {
14-
jshintrc: '.jshintrc'
15+
jshintrc: ".jshintrc"
1516
}
1617
},
1718
jasmine_node: {
18-
specFolders: ['test/spec']//,
19-
// forceExit: true,
19+
specFolders: ["test/spec"]
2020
},
2121
browserify: {
2222
standalone: {
23-
src: [ './src/EVEoj.js' ],
24-
dest: './dist/<%= pkg.name %>.js',
23+
src: ["./src/EVEoj.js"],
24+
dest: "./dist/<%= pkg.name %>.js",
2525
options: {
2626
bundleOptions: {
2727
debug: true,
28-
standalone: '<%= pkg.name %>'
28+
standalone: "<%= pkg.name %>"
2929
}
3030
}
31-
},
31+
}
3232
},
3333
uglify: {
3434
all: {
3535
files: {
36-
'./dist/<%= pkg.name %>.min.js': ['./libs/bluebird-2.2.2-core-progress.js', './dist/<%= pkg.name %>.js']
36+
"./dist/<%= pkg.name %>.min.js": ["./libs/bluebird-2.2.2-core-progress.js", "./dist/<%= pkg.name %>.js"]
3737
}
3838
}
3939
},
4040
watchify: {
4141
options: {
42-
standalone: '<%= pkg.name %>',
42+
standalone: "<%= pkg.name %>",
4343
debug: true
4444
},
4545
all: {
46-
src: './src/EVEoj.js',
47-
dest: './dist/<%= pkg.name %>.js'
46+
src: "./src/EVEoj.js",
47+
dest: "./dist/<%= pkg.name %>.js"
4848
}
4949
}
5050
});
5151

5252
// Load plug-ins
53-
grunt.loadNpmTasks('grunt-contrib-watch');
54-
grunt.loadNpmTasks('grunt-contrib-jasmine');
55-
grunt.loadNpmTasks('grunt-browserify');
56-
grunt.loadNpmTasks('grunt-contrib-jshint');
57-
grunt.loadNpmTasks('grunt-jasmine-node');
58-
grunt.loadNpmTasks('grunt-contrib-uglify');
59-
grunt.loadNpmTasks('grunt-watchify');
53+
grunt.loadNpmTasks("grunt-contrib-watch");
54+
grunt.loadNpmTasks("grunt-contrib-jasmine");
55+
grunt.loadNpmTasks("grunt-browserify");
56+
grunt.loadNpmTasks("grunt-contrib-jshint");
57+
grunt.loadNpmTasks("grunt-jasmine-node");
58+
grunt.loadNpmTasks("grunt-contrib-uglify");
59+
grunt.loadNpmTasks("grunt-watchify");
6060

6161
// define tasks
62-
grunt.registerTask('default', [
63-
//'jshint',
64-
// 'jasmine_node',
65-
'browserify',
66-
// 'jasmine',
67-
'uglify'
62+
grunt.registerTask("default", [
63+
"jshint",
64+
"jasmine_node",
65+
"browserify",
66+
// "jasmine",
67+
"uglify"
6868
]);
6969
};

0 commit comments

Comments
 (0)