parent
5f623f2f0e
commit
f6a90ad166
|
@ -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));
|
||||
}
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue
Block a user