Skip to content

Commit 7bae782

Browse files
committed
fix: fixed linting errors regarding no-unused-expressions.
1 parent 214d8cb commit 7bae782

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/keys/KeyRing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,8 @@ class KeyRing {
947947
`${this.dbKeyPath}.tmp`,
948948
dbJWEJSON,
949949
'utf-8',
950-
),
951-
await this.fs.promises.rename(`${this.dbKeyPath}.tmp`, this.dbKeyPath);
950+
);
951+
await this.fs.promises.rename(`${this.dbKeyPath}.tmp`, this.dbKeyPath);
952952
} catch (e) {
953953
throw new keysErrors.ErrorDBKeyWrite(
954954
`DB key path ${this.dbKeyPath} cannot be written to`,

tests/client/handlers/identities.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ describe('identitiesClaim', () => {
476476
.mockImplementation(async (payload, _, func) => {
477477
const token = Token.fromPayload(payload);
478478
// We need to call the function to resolve a promise in the code
479-
func != null && (await func(token as unknown as Token<Claim>));
479+
if (func) {
480+
await func(token as unknown as Token<Claim>);
481+
}
480482
return [claimId, signedClaim];
481483
});
482484

@@ -1750,7 +1752,9 @@ describe('identitiesInvite', () => {
17501752
.mockImplementation(async (payload, _, func) => {
17511753
const token = Token.fromPayload(payload);
17521754
// We need to call the function to resolve a promise in the code
1753-
func != null && (await func(token as unknown as Token<Claim>));
1755+
if (func) {
1756+
await func(token as unknown as Token<Claim>);
1757+
}
17541758
return [claimId, signedClaim];
17551759
});
17561760

tests/keys/KeyRing.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe(KeyRing.name, () => {
4545
keysErrors.ErrorKeyRingDestroyed,
4646
);
4747
expect(() => {
48-
keyRing.keyPair;
48+
void keyRing.keyPair;
4949
}).toThrow(keysErrors.ErrorKeyRingNotRunning);
5050
await expect(async () => {
5151
await keyRing.checkPassword(password);

0 commit comments

Comments
 (0)