Fix: simplify getAnnotations

This commit is contained in:
eight 2018-09-02 14:34:37 +08:00
parent 0d9e1368b4
commit 8531d20c55

View File

@ -54,16 +54,8 @@ var linter = (() => {
}
function getAnnotations(...args) {
const result = [];
return Promise.all(linters.map(fn => fn(...args)))
.then(results => {
for (const annotations of results) {
if (annotations) {
result.push(...annotations);
}
}
return result;
});
.then(results => [].concat(...results.filter(Boolean)));
}
})();