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,
|
||||
'empty-rules': 1,
|
||||
'errors': 1,
|
||||
'warnings': 1,
|
||||
'known-properties': 1,
|
||||
|
||||
// Default disabled
|
||||
|
|
|
@ -59,7 +59,7 @@ var linterConfig = {
|
|||
// always use default syntax because we don't expose it in config UI
|
||||
config.syntax = this.defaults.stylelint.syntax;
|
||||
}
|
||||
return config;
|
||||
return Object.assign({}, this.defaults[linter] || {}, config);
|
||||
} else {
|
||||
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({
|
||||
id: 'fallback-colors',
|
||||
name: 'Require fallback colors',
|
||||
|
|
|
@ -4627,7 +4627,7 @@ self.parserlib = (() => {
|
|||
parts[0].modifiers.length + (parts[0].elementName ? 1 : 0) > 1 ||
|
||||
/^:not\b/i.test(parts[0])) {
|
||||
this.fire({
|
||||
type: 'error',
|
||||
type: 'warning',
|
||||
message: `Simple selector expected, but found '${arg.join(', ')}'`,
|
||||
}, arg[0]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user