suppress stylelint warning for stylus-lang's @css block

fixes #459
This commit is contained in:
tophf 2018-08-06 15:10:42 +03:00
parent 5f623f2f0e
commit f6a90ad166

View File

@ -15,9 +15,9 @@
severity,
}).filter(Boolean),
stylelint: ({results}) =>
!results[0] && [] ||
results[0].warnings.map(({line, column: ch, text, severity}) => ({
stylelint({results}, cm) {
if (!results[0]) return [];
const output = results[0].warnings.map(({line, column: ch, text, severity}) => ({
from: {line: line - 1, ch: ch - 1},
to: {line: line - 1, ch},
message: text
@ -26,12 +26,18 @@
.replace(/\s*\([^(]+\)$/, ''), // strip the rule,
rule: text.replace(/^.*?\s*\(([^(]+)\)$/, '$1'),
severity,
})),
}));
return cm.doc.mode.name !== 'stylus' ?
output :
output.filter(({message}) =>
!message.includes('"@css"') || !message.includes('(at-rule-no-unknown)'));
},
};
function invokeHelper(code) {
function invokeHelper(code, options, cm) {
const config = linterConfig.getCurrent();
const cook = cookResults[linterConfig.getName()];
return linterConfig.invokeWorker({code, config})
.then(cookResults[linterConfig.getName()]);
.then(data => cook(data, cm));
}
})();