forked from brandonramirez/grunt-jsonlint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
107 lines (100 loc) · 2.28 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
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
module.exports = (grunt) => {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
eslint: {
gruntfile: {
src: [ 'Gruntfile.js' ]
},
tasks: {
src: [ 'tasks/*.js', 'lib/*.js' ]
},
tests: {
src: [ 'test/*.js' ]
}
},
jsonlint: {
sample: {
src: [ 'test/valid.json' ],
options: {
formatter: 'msbuild',
reporter: 'jshint'
}
},
packageJson: {
src: [ 'package.json' ]
},
comments: {
src: [ 'test/cjson.json' ],
options: {
ignoreComments: true
}
},
singleQuotes: {
src: [ 'test/single-quotes.json' ],
options: {
allowSingleQuotedStrings: true
}
},
schema: {
src: [ 'test/3.json' ],
options: {
schema: {
environment: 'draft-04',
src: 'test/3.schema.json'
}
}
},
trailingCommas: {
src: [ 'test/trailing-commas.json' ],
options: {
ignoreTrailingCommas: true
}
},
json5: {
src: [ 'test/json5.json' ],
options: {
mode: 'json5'
}
},
overflowTest: {
src: [ 'test/issue13/**/*.json' ]
},
invalid: {
src: [ 'test/invalid.json' ]
},
invalidVisualStudio: {
src: [ 'test/invalid.json' ],
options: {
formatter: 'msbuild'
}
},
invalidJshintStyle: {
src: [ 'test/invalid.json' ],
options: {
reporter: 'jshint'
}
}
},
mochaTest: {
options: {
reporter: 'spec'
},
unitTests: {
src: [ 'test/unit-tests.js' ]
},
issue13Tests: {
src: [ 'test/issue13-tests.js' ]
}
}
});
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-mocha-test');
require('./tasks/jsonlint')(grunt); // eslint-disable-line global-require
grunt.registerTask('test', [
'eslint', 'jsonlint:sample', 'jsonlint:packageJson', 'jsonlint:comments',
'jsonlint:singleQuotes', 'jsonlint:trailingCommas', 'jsonlint:json5', 'mochaTest'
]);
// Default task(s).
grunt.registerTask('default', [ 'test' ]);
};