muting CSSLint's unicode-range warning, muting CSSLint hsl color code warning
This commit is contained in:
parent
1f8c46e9cf
commit
55fd654713
|
@ -19,7 +19,7 @@ CodeMirror.registerHelper("lint", "css", function(text) {
|
|||
var found = [];
|
||||
if (!window.CSSLint) return found;
|
||||
|
||||
// STYLISH: hack start
|
||||
/* STYLISH: hack start (part 1) */
|
||||
var rules = CSSLint.getRules();
|
||||
var allowedRules = ["display-property-grouping", "duplicate-properties", "empty-rules", "errors", "known-properties"];
|
||||
CSSLint.clearRules();
|
||||
|
@ -28,11 +28,28 @@ CodeMirror.registerHelper("lint", "css", function(text) {
|
|||
CSSLint.addRule(rule);
|
||||
}
|
||||
});
|
||||
// STYLISH: hack end
|
||||
/* STYLISH: hack end */
|
||||
|
||||
var results = CSSLint.verify(text), messages = results.messages, message = null;
|
||||
for ( var i = 0; i < messages.length; i++) {
|
||||
message = messages[i];
|
||||
|
||||
/* STYLISH: hack start (part 2) */
|
||||
if (message.type === 'warning') {
|
||||
// @font-face {font-family: 'Ampersand'; unicode-range: U+26;}
|
||||
if (message.message.indexOf('unicode-range') !== -1) {
|
||||
continue;
|
||||
}
|
||||
else if ( // color: hsl(210, 100%, 2.2%);
|
||||
message.message.startsWith('Expected (<color>) but found \'hsl') &&
|
||||
/hsl\((\d+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\)/.test(message.message)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
}
|
||||
/* STYLISH: hack end */
|
||||
|
||||
var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col;
|
||||
found.push({
|
||||
from: CodeMirror.Pos(startLine, startCol),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Stylus",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "__MSG_description__",
|
||||
"homepage_url": "https://github.com/schomery/stylish-chrome",
|
||||
"manifest_version": 2,
|
||||
|
|
Loading…
Reference in New Issue
Block a user