Edit File by line
/home/barbar84/www/wp-inclu.../js/codemirr...
File: csslint.js
[10000] Fix | Delete
parser.addListener("endstylesheet", function() {
[10001] Fix | Delete
var prop,
[10002] Fix | Delete
messages = [];
[10003] Fix | Delete
[10004] Fix | Delete
for (prop in headings) {
[10005] Fix | Delete
if (headings.hasOwnProperty(prop)) {
[10006] Fix | Delete
if (headings[prop] > 1) {
[10007] Fix | Delete
messages.push(headings[prop] + " " + prop + "s");
[10008] Fix | Delete
}
[10009] Fix | Delete
}
[10010] Fix | Delete
}
[10011] Fix | Delete
[10012] Fix | Delete
if (messages.length) {
[10013] Fix | Delete
reporter.rollupWarn("You have " + messages.join(", ") + " defined in this stylesheet.", rule);
[10014] Fix | Delete
}
[10015] Fix | Delete
});
[10016] Fix | Delete
}
[10017] Fix | Delete
[10018] Fix | Delete
});
[10019] Fix | Delete
[10020] Fix | Delete
/*
[10021] Fix | Delete
* Rule: Don't use universal selector because it's slow.
[10022] Fix | Delete
*/
[10023] Fix | Delete
[10024] Fix | Delete
CSSLint.addRule({
[10025] Fix | Delete
[10026] Fix | Delete
// rule information
[10027] Fix | Delete
id: "universal-selector",
[10028] Fix | Delete
name: "Disallow universal selector",
[10029] Fix | Delete
desc: "The universal selector (*) is known to be slow.",
[10030] Fix | Delete
url: "https://github.com/CSSLint/csslint/wiki/Disallow-universal-selector",
[10031] Fix | Delete
browsers: "All",
[10032] Fix | Delete
[10033] Fix | Delete
// initialization
[10034] Fix | Delete
init: function(parser, reporter) {
[10035] Fix | Delete
"use strict";
[10036] Fix | Delete
var rule = this;
[10037] Fix | Delete
[10038] Fix | Delete
parser.addListener("startrule", function(event) {
[10039] Fix | Delete
var selectors = event.selectors,
[10040] Fix | Delete
selector,
[10041] Fix | Delete
part,
[10042] Fix | Delete
i;
[10043] Fix | Delete
[10044] Fix | Delete
for (i=0; i < selectors.length; i++) {
[10045] Fix | Delete
selector = selectors[i];
[10046] Fix | Delete
[10047] Fix | Delete
part = selector.parts[selector.parts.length-1];
[10048] Fix | Delete
if (part.elementName === "*") {
[10049] Fix | Delete
reporter.report(rule.desc, part.line, part.col, rule);
[10050] Fix | Delete
}
[10051] Fix | Delete
}
[10052] Fix | Delete
});
[10053] Fix | Delete
}
[10054] Fix | Delete
[10055] Fix | Delete
});
[10056] Fix | Delete
[10057] Fix | Delete
/*
[10058] Fix | Delete
* Rule: Don't use unqualified attribute selectors because they're just like universal selectors.
[10059] Fix | Delete
*/
[10060] Fix | Delete
[10061] Fix | Delete
CSSLint.addRule({
[10062] Fix | Delete
[10063] Fix | Delete
// rule information
[10064] Fix | Delete
id: "unqualified-attributes",
[10065] Fix | Delete
name: "Disallow unqualified attribute selectors",
[10066] Fix | Delete
desc: "Unqualified attribute selectors are known to be slow.",
[10067] Fix | Delete
url: "https://github.com/CSSLint/csslint/wiki/Disallow-unqualified-attribute-selectors",
[10068] Fix | Delete
browsers: "All",
[10069] Fix | Delete
[10070] Fix | Delete
// initialization
[10071] Fix | Delete
init: function(parser, reporter) {
[10072] Fix | Delete
"use strict";
[10073] Fix | Delete
[10074] Fix | Delete
var rule = this;
[10075] Fix | Delete
[10076] Fix | Delete
parser.addListener("startrule", function(event) {
[10077] Fix | Delete
[10078] Fix | Delete
var selectors = event.selectors,
[10079] Fix | Delete
selectorContainsClassOrId = false,
[10080] Fix | Delete
selector,
[10081] Fix | Delete
part,
[10082] Fix | Delete
modifier,
[10083] Fix | Delete
i, k;
[10084] Fix | Delete
[10085] Fix | Delete
for (i=0; i < selectors.length; i++) {
[10086] Fix | Delete
selector = selectors[i];
[10087] Fix | Delete
[10088] Fix | Delete
part = selector.parts[selector.parts.length-1];
[10089] Fix | Delete
if (part.type === parser.SELECTOR_PART_TYPE) {
[10090] Fix | Delete
for (k=0; k < part.modifiers.length; k++) {
[10091] Fix | Delete
modifier = part.modifiers[k];
[10092] Fix | Delete
[10093] Fix | Delete
if (modifier.type === "class" || modifier.type === "id") {
[10094] Fix | Delete
selectorContainsClassOrId = true;
[10095] Fix | Delete
break;
[10096] Fix | Delete
}
[10097] Fix | Delete
}
[10098] Fix | Delete
[10099] Fix | Delete
if (!selectorContainsClassOrId) {
[10100] Fix | Delete
for (k=0; k < part.modifiers.length; k++) {
[10101] Fix | Delete
modifier = part.modifiers[k];
[10102] Fix | Delete
if (modifier.type === "attribute" && (!part.elementName || part.elementName === "*")) {
[10103] Fix | Delete
reporter.report(rule.desc, part.line, part.col, rule);
[10104] Fix | Delete
}
[10105] Fix | Delete
}
[10106] Fix | Delete
}
[10107] Fix | Delete
}
[10108] Fix | Delete
[10109] Fix | Delete
}
[10110] Fix | Delete
});
[10111] Fix | Delete
}
[10112] Fix | Delete
[10113] Fix | Delete
});
[10114] Fix | Delete
[10115] Fix | Delete
/*
[10116] Fix | Delete
* Rule: When using a vendor-prefixed property, make sure to
[10117] Fix | Delete
* include the standard one.
[10118] Fix | Delete
*/
[10119] Fix | Delete
[10120] Fix | Delete
CSSLint.addRule({
[10121] Fix | Delete
[10122] Fix | Delete
// rule information
[10123] Fix | Delete
id: "vendor-prefix",
[10124] Fix | Delete
name: "Require standard property with vendor prefix",
[10125] Fix | Delete
desc: "When using a vendor-prefixed property, make sure to include the standard one.",
[10126] Fix | Delete
url: "https://github.com/CSSLint/csslint/wiki/Require-standard-property-with-vendor-prefix",
[10127] Fix | Delete
browsers: "All",
[10128] Fix | Delete
[10129] Fix | Delete
// initialization
[10130] Fix | Delete
init: function(parser, reporter) {
[10131] Fix | Delete
"use strict";
[10132] Fix | Delete
var rule = this,
[10133] Fix | Delete
properties,
[10134] Fix | Delete
num,
[10135] Fix | Delete
propertiesToCheck = {
[10136] Fix | Delete
"-webkit-border-radius": "border-radius",
[10137] Fix | Delete
"-webkit-border-top-left-radius": "border-top-left-radius",
[10138] Fix | Delete
"-webkit-border-top-right-radius": "border-top-right-radius",
[10139] Fix | Delete
"-webkit-border-bottom-left-radius": "border-bottom-left-radius",
[10140] Fix | Delete
"-webkit-border-bottom-right-radius": "border-bottom-right-radius",
[10141] Fix | Delete
[10142] Fix | Delete
"-o-border-radius": "border-radius",
[10143] Fix | Delete
"-o-border-top-left-radius": "border-top-left-radius",
[10144] Fix | Delete
"-o-border-top-right-radius": "border-top-right-radius",
[10145] Fix | Delete
"-o-border-bottom-left-radius": "border-bottom-left-radius",
[10146] Fix | Delete
"-o-border-bottom-right-radius": "border-bottom-right-radius",
[10147] Fix | Delete
[10148] Fix | Delete
"-moz-border-radius": "border-radius",
[10149] Fix | Delete
"-moz-border-radius-topleft": "border-top-left-radius",
[10150] Fix | Delete
"-moz-border-radius-topright": "border-top-right-radius",
[10151] Fix | Delete
"-moz-border-radius-bottomleft": "border-bottom-left-radius",
[10152] Fix | Delete
"-moz-border-radius-bottomright": "border-bottom-right-radius",
[10153] Fix | Delete
[10154] Fix | Delete
"-moz-column-count": "column-count",
[10155] Fix | Delete
"-webkit-column-count": "column-count",
[10156] Fix | Delete
[10157] Fix | Delete
"-moz-column-gap": "column-gap",
[10158] Fix | Delete
"-webkit-column-gap": "column-gap",
[10159] Fix | Delete
[10160] Fix | Delete
"-moz-column-rule": "column-rule",
[10161] Fix | Delete
"-webkit-column-rule": "column-rule",
[10162] Fix | Delete
[10163] Fix | Delete
"-moz-column-rule-style": "column-rule-style",
[10164] Fix | Delete
"-webkit-column-rule-style": "column-rule-style",
[10165] Fix | Delete
[10166] Fix | Delete
"-moz-column-rule-color": "column-rule-color",
[10167] Fix | Delete
"-webkit-column-rule-color": "column-rule-color",
[10168] Fix | Delete
[10169] Fix | Delete
"-moz-column-rule-width": "column-rule-width",
[10170] Fix | Delete
"-webkit-column-rule-width": "column-rule-width",
[10171] Fix | Delete
[10172] Fix | Delete
"-moz-column-width": "column-width",
[10173] Fix | Delete
"-webkit-column-width": "column-width",
[10174] Fix | Delete
[10175] Fix | Delete
"-webkit-column-span": "column-span",
[10176] Fix | Delete
"-webkit-columns": "columns",
[10177] Fix | Delete
[10178] Fix | Delete
"-moz-box-shadow": "box-shadow",
[10179] Fix | Delete
"-webkit-box-shadow": "box-shadow",
[10180] Fix | Delete
[10181] Fix | Delete
"-moz-transform": "transform",
[10182] Fix | Delete
"-webkit-transform": "transform",
[10183] Fix | Delete
"-o-transform": "transform",
[10184] Fix | Delete
"-ms-transform": "transform",
[10185] Fix | Delete
[10186] Fix | Delete
"-moz-transform-origin": "transform-origin",
[10187] Fix | Delete
"-webkit-transform-origin": "transform-origin",
[10188] Fix | Delete
"-o-transform-origin": "transform-origin",
[10189] Fix | Delete
"-ms-transform-origin": "transform-origin",
[10190] Fix | Delete
[10191] Fix | Delete
"-moz-box-sizing": "box-sizing",
[10192] Fix | Delete
"-webkit-box-sizing": "box-sizing"
[10193] Fix | Delete
};
[10194] Fix | Delete
[10195] Fix | Delete
// event handler for beginning of rules
[10196] Fix | Delete
function startRule() {
[10197] Fix | Delete
properties = {};
[10198] Fix | Delete
num = 1;
[10199] Fix | Delete
}
[10200] Fix | Delete
[10201] Fix | Delete
// event handler for end of rules
[10202] Fix | Delete
function endRule() {
[10203] Fix | Delete
var prop,
[10204] Fix | Delete
i,
[10205] Fix | Delete
len,
[10206] Fix | Delete
needed,
[10207] Fix | Delete
actual,
[10208] Fix | Delete
needsStandard = [];
[10209] Fix | Delete
[10210] Fix | Delete
for (prop in properties) {
[10211] Fix | Delete
if (propertiesToCheck[prop]) {
[10212] Fix | Delete
needsStandard.push({
[10213] Fix | Delete
actual: prop,
[10214] Fix | Delete
needed: propertiesToCheck[prop]
[10215] Fix | Delete
});
[10216] Fix | Delete
}
[10217] Fix | Delete
}
[10218] Fix | Delete
[10219] Fix | Delete
for (i=0, len=needsStandard.length; i < len; i++) {
[10220] Fix | Delete
needed = needsStandard[i].needed;
[10221] Fix | Delete
actual = needsStandard[i].actual;
[10222] Fix | Delete
[10223] Fix | Delete
if (!properties[needed]) {
[10224] Fix | Delete
reporter.report("Missing standard property '" + needed + "' to go along with '" + actual + "'.", properties[actual][0].name.line, properties[actual][0].name.col, rule);
[10225] Fix | Delete
} else {
[10226] Fix | Delete
// make sure standard property is last
[10227] Fix | Delete
if (properties[needed][0].pos < properties[actual][0].pos) {
[10228] Fix | Delete
reporter.report("Standard property '" + needed + "' should come after vendor-prefixed property '" + actual + "'.", properties[actual][0].name.line, properties[actual][0].name.col, rule);
[10229] Fix | Delete
}
[10230] Fix | Delete
}
[10231] Fix | Delete
}
[10232] Fix | Delete
[10233] Fix | Delete
}
[10234] Fix | Delete
[10235] Fix | Delete
parser.addListener("startrule", startRule);
[10236] Fix | Delete
parser.addListener("startfontface", startRule);
[10237] Fix | Delete
parser.addListener("startpage", startRule);
[10238] Fix | Delete
parser.addListener("startpagemargin", startRule);
[10239] Fix | Delete
parser.addListener("startkeyframerule", startRule);
[10240] Fix | Delete
parser.addListener("startviewport", startRule);
[10241] Fix | Delete
[10242] Fix | Delete
parser.addListener("property", function(event) {
[10243] Fix | Delete
var name = event.property.text.toLowerCase();
[10244] Fix | Delete
[10245] Fix | Delete
if (!properties[name]) {
[10246] Fix | Delete
properties[name] = [];
[10247] Fix | Delete
}
[10248] Fix | Delete
[10249] Fix | Delete
properties[name].push({
[10250] Fix | Delete
name: event.property,
[10251] Fix | Delete
value: event.value,
[10252] Fix | Delete
pos: num++
[10253] Fix | Delete
});
[10254] Fix | Delete
});
[10255] Fix | Delete
[10256] Fix | Delete
parser.addListener("endrule", endRule);
[10257] Fix | Delete
parser.addListener("endfontface", endRule);
[10258] Fix | Delete
parser.addListener("endpage", endRule);
[10259] Fix | Delete
parser.addListener("endpagemargin", endRule);
[10260] Fix | Delete
parser.addListener("endkeyframerule", endRule);
[10261] Fix | Delete
parser.addListener("endviewport", endRule);
[10262] Fix | Delete
}
[10263] Fix | Delete
[10264] Fix | Delete
});
[10265] Fix | Delete
[10266] Fix | Delete
/*
[10267] Fix | Delete
* Rule: You don't need to specify units when a value is 0.
[10268] Fix | Delete
*/
[10269] Fix | Delete
[10270] Fix | Delete
CSSLint.addRule({
[10271] Fix | Delete
[10272] Fix | Delete
// rule information
[10273] Fix | Delete
id: "zero-units",
[10274] Fix | Delete
name: "Disallow units for 0 values",
[10275] Fix | Delete
desc: "You don't need to specify units when a value is 0.",
[10276] Fix | Delete
url: "https://github.com/CSSLint/csslint/wiki/Disallow-units-for-zero-values",
[10277] Fix | Delete
browsers: "All",
[10278] Fix | Delete
[10279] Fix | Delete
// initialization
[10280] Fix | Delete
init: function(parser, reporter) {
[10281] Fix | Delete
"use strict";
[10282] Fix | Delete
var rule = this;
[10283] Fix | Delete
[10284] Fix | Delete
// count how many times "float" is used
[10285] Fix | Delete
parser.addListener("property", function(event) {
[10286] Fix | Delete
var parts = event.value.parts,
[10287] Fix | Delete
i = 0,
[10288] Fix | Delete
len = parts.length;
[10289] Fix | Delete
[10290] Fix | Delete
while (i < len) {
[10291] Fix | Delete
if ((parts[i].units || parts[i].type === "percentage") && parts[i].value === 0 && parts[i].type !== "time") {
[10292] Fix | Delete
reporter.report("Values of 0 shouldn't have units specified.", parts[i].line, parts[i].col, rule);
[10293] Fix | Delete
}
[10294] Fix | Delete
i++;
[10295] Fix | Delete
}
[10296] Fix | Delete
[10297] Fix | Delete
});
[10298] Fix | Delete
[10299] Fix | Delete
}
[10300] Fix | Delete
[10301] Fix | Delete
});
[10302] Fix | Delete
[10303] Fix | Delete
(function() {
[10304] Fix | Delete
"use strict";
[10305] Fix | Delete
[10306] Fix | Delete
/**
[10307] Fix | Delete
* Replace special characters before write to output.
[10308] Fix | Delete
*
[10309] Fix | Delete
* Rules:
[10310] Fix | Delete
* - single quotes is the escape sequence for double-quotes
[10311] Fix | Delete
* - &amp; is the escape sequence for &
[10312] Fix | Delete
* - &lt; is the escape sequence for <
[10313] Fix | Delete
* - &gt; is the escape sequence for >
[10314] Fix | Delete
*
[10315] Fix | Delete
* @param {String} message to escape
[10316] Fix | Delete
* @return escaped message as {String}
[10317] Fix | Delete
*/
[10318] Fix | Delete
var xmlEscape = function(str) {
[10319] Fix | Delete
if (!str || str.constructor !== String) {
[10320] Fix | Delete
return "";
[10321] Fix | Delete
}
[10322] Fix | Delete
[10323] Fix | Delete
return str.replace(/["&><]/g, function(match) {
[10324] Fix | Delete
switch (match) {
[10325] Fix | Delete
case "\"":
[10326] Fix | Delete
return "&quot;";
[10327] Fix | Delete
case "&":
[10328] Fix | Delete
return "&amp;";
[10329] Fix | Delete
case "<":
[10330] Fix | Delete
return "&lt;";
[10331] Fix | Delete
case ">":
[10332] Fix | Delete
return "&gt;";
[10333] Fix | Delete
}
[10334] Fix | Delete
});
[10335] Fix | Delete
};
[10336] Fix | Delete
[10337] Fix | Delete
CSSLint.addFormatter({
[10338] Fix | Delete
// format information
[10339] Fix | Delete
id: "checkstyle-xml",
[10340] Fix | Delete
name: "Checkstyle XML format",
[10341] Fix | Delete
[10342] Fix | Delete
/**
[10343] Fix | Delete
* Return opening root XML tag.
[10344] Fix | Delete
* @return {String} to prepend before all results
[10345] Fix | Delete
*/
[10346] Fix | Delete
startFormat: function() {
[10347] Fix | Delete
return "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle>";
[10348] Fix | Delete
},
[10349] Fix | Delete
[10350] Fix | Delete
/**
[10351] Fix | Delete
* Return closing root XML tag.
[10352] Fix | Delete
* @return {String} to append after all results
[10353] Fix | Delete
*/
[10354] Fix | Delete
endFormat: function() {
[10355] Fix | Delete
return "</checkstyle>";
[10356] Fix | Delete
},
[10357] Fix | Delete
[10358] Fix | Delete
/**
[10359] Fix | Delete
* Returns message when there is a file read error.
[10360] Fix | Delete
* @param {String} filename The name of the file that caused the error.
[10361] Fix | Delete
* @param {String} message The error message
[10362] Fix | Delete
* @return {String} The error message.
[10363] Fix | Delete
*/
[10364] Fix | Delete
readError: function(filename, message) {
[10365] Fix | Delete
return "<file name=\"" + xmlEscape(filename) + "\"><error line=\"0\" column=\"0\" severty=\"error\" message=\"" + xmlEscape(message) + "\"></error></file>";
[10366] Fix | Delete
},
[10367] Fix | Delete
[10368] Fix | Delete
/**
[10369] Fix | Delete
* Given CSS Lint results for a file, return output for this format.
[10370] Fix | Delete
* @param results {Object} with error and warning messages
[10371] Fix | Delete
* @param filename {String} relative file path
[10372] Fix | Delete
* @param options {Object} (UNUSED for now) specifies special handling of output
[10373] Fix | Delete
* @return {String} output for results
[10374] Fix | Delete
*/
[10375] Fix | Delete
formatResults: function(results, filename/*, options*/) {
[10376] Fix | Delete
var messages = results.messages,
[10377] Fix | Delete
output = [];
[10378] Fix | Delete
[10379] Fix | Delete
/**
[10380] Fix | Delete
* Generate a source string for a rule.
[10381] Fix | Delete
* Checkstyle source strings usually resemble Java class names e.g
[10382] Fix | Delete
* net.csslint.SomeRuleName
[10383] Fix | Delete
* @param {Object} rule
[10384] Fix | Delete
* @return rule source as {String}
[10385] Fix | Delete
*/
[10386] Fix | Delete
var generateSource = function(rule) {
[10387] Fix | Delete
if (!rule || !("name" in rule)) {
[10388] Fix | Delete
return "";
[10389] Fix | Delete
}
[10390] Fix | Delete
return "net.csslint." + rule.name.replace(/\s/g, "");
[10391] Fix | Delete
};
[10392] Fix | Delete
[10393] Fix | Delete
[10394] Fix | Delete
if (messages.length > 0) {
[10395] Fix | Delete
output.push("<file name=\""+filename+"\">");
[10396] Fix | Delete
CSSLint.Util.forEach(messages, function (message) {
[10397] Fix | Delete
// ignore rollups for now
[10398] Fix | Delete
if (!message.rollup) {
[10399] Fix | Delete
output.push("<error line=\"" + message.line + "\" column=\"" + message.col + "\" severity=\"" + message.type + "\"" +
[10400] Fix | Delete
" message=\"" + xmlEscape(message.message) + "\" source=\"" + generateSource(message.rule) +"\"/>");
[10401] Fix | Delete
}
[10402] Fix | Delete
});
[10403] Fix | Delete
output.push("</file>");
[10404] Fix | Delete
}
[10405] Fix | Delete
[10406] Fix | Delete
return output.join("");
[10407] Fix | Delete
}
[10408] Fix | Delete
});
[10409] Fix | Delete
[10410] Fix | Delete
}());
[10411] Fix | Delete
[10412] Fix | Delete
CSSLint.addFormatter({
[10413] Fix | Delete
// format information
[10414] Fix | Delete
id: "compact",
[10415] Fix | Delete
name: "Compact, 'porcelain' format",
[10416] Fix | Delete
[10417] Fix | Delete
/**
[10418] Fix | Delete
* Return content to be printed before all file results.
[10419] Fix | Delete
* @return {String} to prepend before all results
[10420] Fix | Delete
*/
[10421] Fix | Delete
startFormat: function() {
[10422] Fix | Delete
"use strict";
[10423] Fix | Delete
return "";
[10424] Fix | Delete
},
[10425] Fix | Delete
[10426] Fix | Delete
/**
[10427] Fix | Delete
* Return content to be printed after all file results.
[10428] Fix | Delete
* @return {String} to append after all results
[10429] Fix | Delete
*/
[10430] Fix | Delete
endFormat: function() {
[10431] Fix | Delete
"use strict";
[10432] Fix | Delete
return "";
[10433] Fix | Delete
},
[10434] Fix | Delete
[10435] Fix | Delete
/**
[10436] Fix | Delete
* Given CSS Lint results for a file, return output for this format.
[10437] Fix | Delete
* @param results {Object} with error and warning messages
[10438] Fix | Delete
* @param filename {String} relative file path
[10439] Fix | Delete
* @param options {Object} (Optional) specifies special handling of output
[10440] Fix | Delete
* @return {String} output for results
[10441] Fix | Delete
*/
[10442] Fix | Delete
formatResults: function(results, filename, options) {
[10443] Fix | Delete
"use strict";
[10444] Fix | Delete
var messages = results.messages,
[10445] Fix | Delete
output = "";
[10446] Fix | Delete
options = options || {};
[10447] Fix | Delete
[10448] Fix | Delete
/**
[10449] Fix | Delete
* Capitalize and return given string.
[10450] Fix | Delete
* @param str {String} to capitalize
[10451] Fix | Delete
* @return {String} capitalized
[10452] Fix | Delete
*/
[10453] Fix | Delete
var capitalize = function(str) {
[10454] Fix | Delete
return str.charAt(0).toUpperCase() + str.slice(1);
[10455] Fix | Delete
};
[10456] Fix | Delete
[10457] Fix | Delete
if (messages.length === 0) {
[10458] Fix | Delete
return options.quiet ? "" : filename + ": Lint Free!";
[10459] Fix | Delete
}
[10460] Fix | Delete
[10461] Fix | Delete
CSSLint.Util.forEach(messages, function(message) {
[10462] Fix | Delete
if (message.rollup) {
[10463] Fix | Delete
output += filename + ": " + capitalize(message.type) + " - " + message.message + " (" + message.rule.id + ")\n";
[10464] Fix | Delete
} else {
[10465] Fix | Delete
output += filename + ": line " + message.line +
[10466] Fix | Delete
", col " + message.col + ", " + capitalize(message.type) + " - " + message.message + " (" + message.rule.id + ")\n";
[10467] Fix | Delete
}
[10468] Fix | Delete
});
[10469] Fix | Delete
[10470] Fix | Delete
return output;
[10471] Fix | Delete
}
[10472] Fix | Delete
});
[10473] Fix | Delete
[10474] Fix | Delete
CSSLint.addFormatter({
[10475] Fix | Delete
// format information
[10476] Fix | Delete
id: "csslint-xml",
[10477] Fix | Delete
name: "CSSLint XML format",
[10478] Fix | Delete
[10479] Fix | Delete
/**
[10480] Fix | Delete
* Return opening root XML tag.
[10481] Fix | Delete
* @return {String} to prepend before all results
[10482] Fix | Delete
*/
[10483] Fix | Delete
startFormat: function() {
[10484] Fix | Delete
"use strict";
[10485] Fix | Delete
return "<?xml version=\"1.0\" encoding=\"utf-8\"?><csslint>";
[10486] Fix | Delete
},
[10487] Fix | Delete
[10488] Fix | Delete
/**
[10489] Fix | Delete
* Return closing root XML tag.
[10490] Fix | Delete
* @return {String} to append after all results
[10491] Fix | Delete
*/
[10492] Fix | Delete
endFormat: function() {
[10493] Fix | Delete
"use strict";
[10494] Fix | Delete
return "</csslint>";
[10495] Fix | Delete
},
[10496] Fix | Delete
[10497] Fix | Delete
/**
[10498] Fix | Delete
* Given CSS Lint results for a file, return output for this format.
[10499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function