report invalid selector in :not() as a warning
to prevent failures when updating usercss styles that have to override [currently] invalid :not() selectors used by the site see #356
This commit is contained in:
parent
808ad0f059
commit
5acf815b79
|
@ -10,6 +10,7 @@ window.linterConfig.defaults.csslint = {
|
||||||
'duplicate-properties': 1,
|
'duplicate-properties': 1,
|
||||||
'empty-rules': 1,
|
'empty-rules': 1,
|
||||||
'errors': 1,
|
'errors': 1,
|
||||||
|
'warnings': 1,
|
||||||
'known-properties': 1,
|
'known-properties': 1,
|
||||||
|
|
||||||
// Default disabled
|
// Default disabled
|
||||||
|
|
|
@ -59,7 +59,7 @@ var linterConfig = {
|
||||||
// always use default syntax because we don't expose it in config UI
|
// always use default syntax because we don't expose it in config UI
|
||||||
config.syntax = this.defaults.stylelint.syntax;
|
config.syntax = this.defaults.stylelint.syntax;
|
||||||
}
|
}
|
||||||
return config;
|
return Object.assign({}, this.defaults[linter] || {}, config);
|
||||||
} else {
|
} else {
|
||||||
return deepCopy(this.defaults[linter] || {});
|
return deepCopy(this.defaults[linter] || {});
|
||||||
}
|
}
|
||||||
|
|
|
@ -857,6 +857,19 @@ CSSLint.addRule({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
CSSLint.addRule({
|
||||||
|
id: 'warnings',
|
||||||
|
name: 'Parsing warnings',
|
||||||
|
desc: 'This rule looks for parser warnings.',
|
||||||
|
browsers: 'All',
|
||||||
|
|
||||||
|
init(parser, reporter) {
|
||||||
|
parser.addListener('warning', ({message, line, col}) => {
|
||||||
|
reporter.report(message, line, col, this);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
CSSLint.addRule({
|
CSSLint.addRule({
|
||||||
id: 'fallback-colors',
|
id: 'fallback-colors',
|
||||||
name: 'Require fallback colors',
|
name: 'Require fallback colors',
|
||||||
|
|
|
@ -4627,7 +4627,7 @@ self.parserlib = (() => {
|
||||||
parts[0].modifiers.length + (parts[0].elementName ? 1 : 0) > 1 ||
|
parts[0].modifiers.length + (parts[0].elementName ? 1 : 0) > 1 ||
|
||||||
/^:not\b/i.test(parts[0])) {
|
/^:not\b/i.test(parts[0])) {
|
||||||
this.fire({
|
this.fire({
|
||||||
type: 'error',
|
type: 'warning',
|
||||||
message: `Simple selector expected, but found '${arg.join(', ')}'`,
|
message: `Simple selector expected, but found '${arg.join(', ')}'`,
|
||||||
}, arg[0]);
|
}, arg[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user