ui: update eslint rules

This commit is contained in:
undefined committed 2022-09-03 14:28:18 +08:00
1 parent 0e07c64cad
commit 5e8d2b1286
30 files changed
+73 -72

No files matched your search

+4 -3
View File
@@ -1,5 +1,6 @@
/* eslint-disable no-await-in-loop */
// eslint-disable-next-line @typescript-eslint/naming-convention
const _hooks: Record<keyof any, Array<(...args: any[]) => any>> = {};
function isBailed(value: any) {
@@ -45,12 +46,12 @@ export function prependListener<K extends keyof EventMap>(name: K, listener: Eve
export function once<K extends keyof EventMap>(name: K, listener: EventMap[K]) {
let dispose;
function _listener(...args: any[]) {
function l(...args: any[]) {
dispose();
return listener.apply(this, args);
}
_listener.toString = () => `// Once \n${listener.toString()}`;
dispose = addListener(name, _listener);
l.toString = () => `// Once \n${listener.toString()}`;
dispose = addListener(name, l);
return dispose;
}