-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGruntfile.js
More file actions
121 lines (119 loc) · 4.03 KB
/
Gruntfile.js
File metadata and controls
121 lines (119 loc) · 4.03 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
module.exports = function(grunt) {
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
htmlhint: {
build: {
options: {
'tag-pair': true,
'tagname-lowercase': true,
'attr-lowercase': true,
'attr-value-double-quotes': true,
//'doctype-first': true,
'spec-char-escape': true,
'id-unique': true,
//'head-script-disabled': false,
'style-disabled': true
},
src: ['index.html', 'app/views/**/*.htm']
}
}, //endhtmlhint
jshint: {
src: ['Gruntfile.js', 'app/**/*.js', 'app/*.js' /*,'tests/app/**/ /*.js'*/ ],
options: {
curly: true,
eqeqeq: true,
immed: true,
jquery: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true,
devel: true,
globals: {
angular: true,
eav: true,
_: true,
config: true,
require: true,
define: true,
requirejs: true,
describe: true,
expect: true,
module: true,
it: true
}
}
},
jsbeautifier: {
files: ['Gruntfile.js', 'app/**/*.js', '!app/modules/**/*.js', 'index.html', 'app/views/**/*.htm'],
options: {
//config: "path/to/configFile",
html: {
braceStyle: "collapse",
indentChar: " ",
indentScripts: "keep",
indentSize: 4,
maxPreserveNewlines: 10,
preserveNewlines: true,
unformatted: ["a", "sub", "sup", "b", "i", "u"],
wrapLineLength: 0
},
css: {
indentChar: " ",
indentSize: 4
},
js: {
braceStyle: "collapse",
breakChainedMethods: false,
e4x: false,
evalCode: false,
indentChar: " ",
indentLevel: 0,
indentSize: 4,
indentWithTabs: false,
jslintHappy: false,
keepArrayIndentation: false,
keepFunctionIndentation: false,
maxPreserveNewlines: 10,
preserveNewlines: true,
spaceBeforeConditional: true,
spaceInParen: false,
unescapeStrings: false,
wrapLineLength: 0
}
}
},
'sails-linker': {
defaultOptions: {
options: {
startTag: '<!--SCRIPTS-->',
endTag: '<!--SCRIPTS END-->',
fileTmpl: '<script src="%s"></script>',
appRoot: ''
},
files: {
// Target-specific file lists and/or options go here.
'index.html': ['app/config/**/*.js', 'app/controllers/**/*.js', 'app/services/**/*.js']
},
},
},
karma: {
unit: {
configFile: 'test/karma.config.js',
autoWatch: true
}
},
watch: {
html: {
files: ['index.html'],
tasks: ['htmlhint']
}
}
});
grunt.registerTask('default', ['htmlhint', 'jshint']);
};