frontend: Add linting for ts code

This commit is contained in:
Tom 2023-07-13 13:51:18 +02:00
parent ddb4bb3546
commit 16fa721048
18 changed files with 2299 additions and 469 deletions

View file

@ -0,0 +1,13 @@
import { Mutex, MutexInterface } from 'async-mutex'
const error = console.error.bind(console)
/** discard discards the result of a promise, or logs an error if it occurs */
export function discard<T> (p: Promise<T>): void {
p.then((): void => {}).catch(error)
}
/** runs worker exclusively on m, and discards the resulting promise */
export function runMutexExclusive<T> (m: Mutex, worker: MutexInterface.Worker<T>): void {
discard(m.runExclusive(worker))
}