-
Notifications
You must be signed in to change notification settings - Fork 476
Expand file tree
/
Copy pathjson.js
More file actions
46 lines (41 loc) · 1.15 KB
/
json.js
File metadata and controls
46 lines (41 loc) · 1.15 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
/* global JSON */
CSSLint.addFormatter({
//format information
id: "json",
name: "CSSLint JSON format",
json: [],
/**
* Return content to be printed before all file results.
* @return {String} to prepend before all results
*/
startFormat: function() {
"use strict";
return "";
},
/**
* Return full JSON
* @return {String} to append after all results
*/
endFormat: function() {
"use strict";
return JSON.stringify(this.json);
},
/**
* Given CSS Lint results for a file, return output for this format.
* @param results {Object} with error and warning messages
* @param filename {String} relative file path
* @param options {Object} (UNUSED for now) specifies special handling of output
* @return {String} output for results
*/
formatResults: function(results, filename, options) {
"use strict";
options = options || {};
if (results.messages.length > 0) {
this.json.push({
filename: filename,
results: results
});
}
return "";
}
});