Skip to content

Commit bffaf28

Browse files
committed
Fix more lint issues
1 parent 03585e3 commit bffaf28

20 files changed

Lines changed: 30 additions & 29 deletions

biome.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
"linter": {
1717
"enabled": true,
1818
"rules": {
19-
"recommended": true
19+
"recommended": true,
20+
"style": {
21+
"noNonNullAssertion": "off"
22+
}
2023
}
2124
}
2225
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"prepublishOnly": "yarn reset && yarn compile && yarn test",
1717
"test": "yarn workspace @rc-ex/test run vitest",
1818
"upgrade-all": "yarn-upgrade-all -W && yarn workspaces run yarn-upgrade-all && yarn install",
19-
"format-lint": "biome check --write ."
19+
"format-lint": "biome check --write --unsafe ."
2020
},
2121
"devDependencies": {
2222
"@biomejs/biome": "^2.4.10",

packages/extensions/events/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { EventEmitter } from "node:events";
12
import type RingCentral from "@rc-ex/core";
23
import type GetTokenRequest from "@rc-ex/core/definitions/GetTokenRequest";
34
import RestException from "@rc-ex/core/RestException";
@@ -7,7 +8,6 @@ import type {
78
RestRequestConfig,
89
RestResponse,
910
} from "@rc-ex/core/types";
10-
import { EventEmitter } from "events";
1111

1212
export enum Events {
1313
beforeRequest = "beforeRequest",

packages/extensions/retry/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class RetryExtension extends SdkExtension {
3030
this.options.shouldRetry ??= (restException, retriesAttempted) =>
3131
retriesAttempted < 3 &&
3232
[429, 503].includes(restException.response.status);
33-
this.options.retryInterval ??= (restException, retriesAttempted) =>
33+
this.options.retryInterval ??= (_restException, retriesAttempted) =>
3434
60 * 1000 * 2 ** retriesAttempted; // exponential back off
3535
}
3636

packages/extensions/ws/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { EventEmitter } from "node:events";
12
import type RingCentral from "@rc-ex/core";
23
import type SubscriptionInfo from "@rc-ex/core/definitions/SubscriptionInfo";
34
import RestException from "@rc-ex/core/RestException";
@@ -7,7 +8,6 @@ import type {
78
RestRequestConfig,
89
RestResponse,
910
} from "@rc-ex/core/types";
10-
import { EventEmitter } from "events";
1111
import hyperid from "hyperid";
1212
import type { MessageEvent } from "isomorphic-ws";
1313
import WS from "isomorphic-ws";
@@ -233,7 +233,7 @@ class WebSocketExtension extends SdkExtension {
233233
if (this.ws?.readyState === OPEN || this.ws?.readyState === CONNECTING) {
234234
return;
235235
}
236-
if (!this.wsc || !this.wsc.token) {
236+
if (!this.wsc?.token) {
237237
await this.connect(false); // connect to WSG but do not recover
238238
return;
239239
}
@@ -275,7 +275,7 @@ class WebSocketExtension extends SdkExtension {
275275
},
276276
]),
277277
);
278-
} catch (e) {
278+
} catch (_e) {
279279
this.ws.close(); // Explicitly mark WS as closed
280280
}
281281
}
@@ -367,7 +367,7 @@ class WebSocketExtension extends SdkExtension {
367367
this.eventEmitter.emit(Events.connectionReady, this.ws);
368368

369369
// recover the subscription, if it exists and enabled
370-
if (this.subscription && this.subscription.enabled) {
370+
if (this.subscription?.enabled) {
371371
// because we have a new ws object
372372
this.subscription.setupWsEventListener();
373373
if (

test/a2p.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import path from "node:path";
12
import DebugExtension from "@rc-ex/debug";
23
import dotenv from "dotenv-override-true";
3-
import path from "path";
44
import { describe, expect, test } from "vitest";
55

66
import ReusableRestClient from "./reusable-rest-client";

test/debug-extension.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import DebugExtension from "@rc-ex/debug";
2-
import { describe, expect, test } from "vitest";
2+
import { describe, test } from "vitest";
33

44
import ReusableRestClient from "./reusable-rest-client";
55

test/download-fax.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import fs from "fs";
2-
import path from "path";
1+
import fs from "node:fs";
2+
import path from "node:path";
33
import { describe, expect, test } from "vitest";
44

55
import ReusableRestClient from "./reusable-rest-client";

test/events-extension.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Utils from "@rc-ex/core/Utils";
22
import EventsExtension, { Events } from "@rc-ex/events";
3-
import { describe, expect, test } from "vitest";
3+
import { describe, test } from "vitest";
44

55
import ReusableRestClient from "./reusable-rest-client";
66

test/exceptions.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import RestException from "@rc-ex/core/RestException";
21
import type { RestResponse } from "@rc-ex/core/types";
32
import { describe, expect, test } from "vitest";
43

0 commit comments

Comments
 (0)