axiomhq/next-axiom

Fix type of `Logger.flush()`

Closed this issue · 1 comments

The Logger class' flush method has an any type, making my typescript-eslint configuration scream at me. I'd recommend allowing TypeScript to just infer types whenever possible and remove the any type here.

next-axiom/src/logger.ts

Lines 197 to 199 in 9ec2a79

flush: any = async () => {
return Promise.all([this.sendLogs(), ...this.children.map((c) => c.flush())]);
};

Seems like this would be a better option as there's no real reason to return anything from the flush method.

 flush = async () => { 
   await Promise.all([this.sendLogs(), ...this.children.map((c) => c.flush())]); 
 };