use current-line mode for csslint allow override

This commit is contained in:
tophf 2020-06-24 09:42:00 +03:00
parent 60a37af0e0
commit 3604556481

View File

@ -230,15 +230,18 @@ var CSSLint = (() => {
// Example 1: // Example 1:
/* csslint ignore:start */ /* csslint ignore:start */
// the chunk of code where errors won't be reported /*
// the chunk's start is hardwired to the line of the opening comment the chunk of code where errors won't be reported
// the chunk's end is hardwired to the line of the closing comment the chunk's start is hardwired to the line of the opening comment
the chunk's end is hardwired to the line of the closing comment
*/
/* csslint ignore:end */ /* csslint ignore:end */
// Example 2: // Example 2:
// allow rule violations on the current line:
/* csslint allow:rulename1,rulename2,... */ // foo: bar; /* csslint allow:rulename1,rulename2,... */
// allows to break the specified rules on the next single line of code /* csslint allow:rulename1,rulename2,... */ // foo: bar;
// Example 3: // Example 3:
@ -246,13 +249,13 @@ var CSSLint = (() => {
/* csslint rulename2:N */ /* csslint rulename2:N */
/* csslint rulename3:N, rulename4:N */ /* csslint rulename3:N, rulename4:N */
// entire code is affected; /* entire code is affected;
// comments futher down the code extend/override previous comments of this kind * comments futher down the code extend/override previous comments of this kind
// values for N: * values for N (without the backquotes):
// "2" or "true" means "error" `2` or `true` means "error"
// "1" or nothing means "warning" - note in this case ":" can also be omitted `1` or omitted means "warning" (when omitting, the colon can be omitted too)
// "0" or "false" means "ignore" `0` or `false` means "ignore"
// (the quotes are added here for convenience, don't put them in the actual comments) */
function applyEmbeddedOverrides(text, ruleset, allow, ignore) { function applyEmbeddedOverrides(text, ruleset, allow, ignore) {
let ignoreStart = null; let ignoreStart = null;
@ -282,7 +285,7 @@ var CSSLint = (() => {
allowRuleset[allowRule.trim()] = true; allowRuleset[allowRule.trim()] = true;
num++; num++;
}); });
if (num) allow[lineno + 1] = allowRuleset; if (num) allow[lineno] = allowRuleset;
break; break;
} }