forked from kellyk/javascript-simon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
80 lines (72 loc) · 2.17 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
69
70
71
72
73
74
75
76
77
78
79
80
module.exports = function(grunt) {
'use strict';
var file_list = [
'js/simon.js',
'Gruntfile.js'
];
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
// Enforcing options
curly: true
// ,forin: true
,eqeqeq: true
,immed: true
,latedef: 'nofunc'
,newcap: true
,noarg: true
,noempty: true
,quotmark: 'single'
// ,undef: true
,unused: true
,strict: true
,trailing: true
,browser: true
,globals: {
node: true
,jQuery: true
,global: true
,Meteor: true
,Accounts: true
,_: true
,Ideas: true
,RouteController: true
,HomeController: true
,using: true
,define: true
,Notifications: true
,Session: true
,Router: true
,Template: true
,process: true
}
// Relaxing options
,boss: true
,laxcomma: true
,globalstrict: true
},
uses_defaults: file_list.concat(['Gruntfile.js'])
},
watch: {
scripts: {
files: file_list,
tasks: ['jshint'],
options: {
spawn: false
,interrupt: true
},
},
},
});
// Load tasks
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['jshint']);
// On file change only run jshint on the changed file not the whole thing
grunt.event.on('watch', function(action, filepath) {
grunt.config('jshint.uses_defaults', filepath);
});
};