code cosmetics

This commit is contained in:
tophf 2018-08-06 15:11:27 +03:00
parent f6a90ad166
commit 2db52c9e2d

View File

@ -5,7 +5,7 @@
CodeMirror.registerHelper('lint', 'csslint', invokeHelper); CodeMirror.registerHelper('lint', 'csslint', invokeHelper);
CodeMirror.registerHelper('lint', 'stylelint', invokeHelper); CodeMirror.registerHelper('lint', 'stylelint', invokeHelper);
const cookResults = { const COOKS = {
csslint: results => csslint: results =>
results.map(({line, col: ch, message, rule, type: severity}) => line && { results.map(({line, col: ch, message, rule, type: severity}) => line && {
message, message,
@ -36,7 +36,7 @@
function invokeHelper(code, options, cm) { function invokeHelper(code, options, cm) {
const config = linterConfig.getCurrent(); const config = linterConfig.getCurrent();
const cook = cookResults[linterConfig.getName()]; const cook = COOKS[linterConfig.getName()];
return linterConfig.invokeWorker({code, config}) return linterConfig.invokeWorker({code, config})
.then(data => cook(data, cm)); .then(data => cook(data, cm));
} }