Fix: simplify getAnnotations
This commit is contained in:
parent
0d9e1368b4
commit
8531d20c55
|
@ -54,16 +54,8 @@ var linter = (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAnnotations(...args) {
|
function getAnnotations(...args) {
|
||||||
const result = [];
|
|
||||||
return Promise.all(linters.map(fn => fn(...args)))
|
return Promise.all(linters.map(fn => fn(...args)))
|
||||||
.then(results => {
|
.then(results => [].concat(...results.filter(Boolean)));
|
||||||
for (const annotations of results) {
|
|
||||||
if (annotations) {
|
|
||||||
result.push(...annotations);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user