-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
68 lines (63 loc) · 2.54 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* `grunt test` - run tests
* `grunt lint` - lint front and backend
* `grunt docs` - create docs
* `grunt validate` - check everything is how it should be before making a pull request a main branch
*/
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
jshint: {
options: {
node : true, // node variables
curly: true, // disallow functions without curly braces
eqeqeq: true, // === and !== instead of == and !=
strict: true, // have to enable strict mode
undef: true, // disallow globally defined variables
noarg: true, // prevents depreciated javascript functions
loopfunc: true, // disallow functions inside loops
immed: true, // disallow immediate functions, they need ()
indent: 4, // force tab indentation to be set to 4
quotmark: 'single', // force use of single quotation marks
camelcase: true, // forces camel case - note this needs to be ignored when using json apis
unused: true, // disallows unused variables
eqnull: true, // allow variable comparison with null or undefined
laxcomma: true, // allow commas before variables or keys
globals: {
},
reporter: require('jshint-stylish')
},
uses_defaults: ['lib/**/**/*.js']
},
jsdox: {
generate: {
options: {
contentsEnabled: true,
contentsTitle: 'Causeway',
contentsFile: 'readme.md'
},
src: ['lib/**/**/*.js', 'test/**/**/*.js'],
dest: 'docs'
}
},
mochaTest: {
lib: {
options: {
reporter: 'spec',
growl: true,
colors: true
},
src: ['test/common.js', 'test/**/**/**/*Spec.js']
}
}
});
// npm modules
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jsdox');
grunt.loadNpmTasks('grunt-mocha-test');
// tasks
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('test', ['mochaTest']);
grunt.registerTask('docs', ['jsdox']);
grunt.registerTask('default', ['mochaTest', 'lint', 'docs']);
};