From 55fd65471363967510c9b700e17e34cba8deaaf6 Mon Sep 17 00:00:00 2001 From: Jeremy Schomery Date: Fri, 3 Mar 2017 14:54:02 +0330 Subject: [PATCH] muting CSSLint's unicode-range warning, muting CSSLint hsl color code warning --- codemirror-overwrites/addon/lint/css-lint.js | 21 ++++++++++++++++++-- manifest.json | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/codemirror-overwrites/addon/lint/css-lint.js b/codemirror-overwrites/addon/lint/css-lint.js index c5c8bb3d..2e1ce7f1 100644 --- a/codemirror-overwrites/addon/lint/css-lint.js +++ b/codemirror-overwrites/addon/lint/css-lint.js @@ -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 () 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), diff --git a/manifest.json b/manifest.json index 53cb3b19..001b60ce 100644 --- a/manifest.json +++ b/manifest.json @@ -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,