Skip to content

Commit f07e2ce

Browse files
committed
style: 💄 fix linter errors
1 parent e976602 commit f07e2ce

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

src/json-crdt-repo/__tests__/testbed.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {pubsub as createPubsub} from '../pubsub';
77
import {BinStrLevel, LevelLocalRepoPubSub} from '../local/level/types';
88
import {EditSessionFactory} from '../session/EditSessionFactory';
99

10+
/* tslint:disable:no-console */
11+
1012
export class Testbed {
1113
public static readonly create = () => {
1214
return new Testbed();

src/json-crdt-repo/local/level/__tests__/LevelLocalRepo.sync.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ describe('.sync()', () => {
420420
id: kit.blockId,
421421
patches: patches2,
422422
});
423-
let events: LocalRepoEvent[] = [];
423+
const events: LocalRepoEvent[] = [];
424424
const subscription = kit.local.change$(kit.blockId).subscribe((e) => {
425425
events.push(e);
426426
});

src/json-crdt-repo/local/level/__tests__/setup.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {MemoryLevel} from 'memory-level';
88
import {BinStrLevel, LevelLocalRepoPubSub} from '../types';
99
import {pubsub as createPubsub} from '../../../pubsub';
1010

11+
/* tslint:disable:no-console */
12+
1113
export const setup = async (
1214
opts: {
1315
remote?: ReturnType<typeof remoteSetup>;

src/json-crdt-repo/session/EditSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export class EditSession {
222222
break;
223223
}
224224
} catch (error) {
225-
// eslint-disable-next-line no-console
225+
// tslint:disable-next-line no-console
226226
console.error('Failed to apply event', event, error);
227227
}
228228
}

src/util/Mutex.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ export class Mutex {
3030
} finally {
3131
const queue = this.queue;
3232
const entries = queue.get(key);
33-
if (!(entries instanceof Array)) return;
34-
if (!entries.length) return void queue.delete(key);
35-
const next = entries.shift();
36-
if (!(next instanceof Entry)) return;
37-
this.run(key, next).catch(() => {});
33+
if (entries instanceof Array) {
34+
if (!entries.length) queue.delete(key);
35+
else {
36+
const next = entries.shift();
37+
if (next instanceof Entry) this.run(key, next).catch(() => {});
38+
}
39+
}
3840
}
3941
}
4042
}

0 commit comments

Comments
 (0)