Skip to content

Commit fe5b95b

Browse files
committed
fix more lint
Signed-off-by: Nik Nasr <[email protected]>
1 parent ddb0142 commit fe5b95b

File tree

4 files changed

+17
-28
lines changed

4 files changed

+17
-28
lines changed

eslint.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ export default [
4747
"error",
4848
{ allowInterfaces: "always" },
4949
],
50-
"@typescript-eslint/require-await": "off",
51-
"@typescript-eslint/no-floating-promises": "off",
52-
"@typescript-eslint/no-duplicate-type-constituents": "off",
53-
"@typescript-eslint/only-throw-error": "off",
54-
"@typescript-eslint/no-empty-function": "off",
5550
"@typescript-eslint/restrict-template-expressions": [
5651
"error",
5752
{
@@ -70,6 +65,8 @@ export default [
7065
],
7166
rules: {
7267
"no-console": "off",
68+
"@typescript-eslint/require-await": "off",
69+
"@typescript-eslint/no-floating-promises": "off",
7370
},
7471
},
7572
{

packages/restate-sdk-clients/src/ingress.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ class HttpIngress implements Ingress {
414414

415415
async resolveAwakeable<T>(
416416
id: string,
417-
payload?: T | undefined,
417+
payload?: T ,
418418
payloadSerde?: Serde<T>
419419
): Promise<void> {
420420
const url = `${this.opts.url}/restate/a/${id}/resolve`;

packages/restate-sdk/src/context_impl.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -817,28 +817,19 @@ class DurablePromiseImpl<T> implements DurablePromise<T> {
817817
}
818818

819819
then<TResult1 = T, TResult2 = never>(
820-
onfulfilled?:
821-
| ((value: T) => TResult1 | PromiseLike<TResult1>)
822-
| null
823-
| undefined,
824-
onrejected?:
825-
| ((reason: any) => TResult2 | PromiseLike<TResult2>)
826-
| null
827-
| undefined
820+
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
821+
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null
828822
): Promise<TResult1 | TResult2> {
829823
return this.get().then(onfulfilled, onrejected);
830824
}
831825

832826
catch<TResult = never>(
833-
onrejected?:
834-
| ((reason: any) => TResult | PromiseLike<TResult>)
835-
| null
836-
| undefined
827+
onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null
837828
): Promise<T | TResult> {
838829
return this.get().catch(onrejected);
839830
}
840831

841-
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
832+
finally(onfinally?: (() => void) | null): Promise<T> {
842833
return this.get().finally(onfinally);
843834
}
844835

@@ -865,7 +856,7 @@ class DurablePromiseImpl<T> implements DurablePromise<T> {
865856
);
866857
}
867858

868-
resolve(value?: T | undefined): Promise<void> {
859+
resolve(value?: T): Promise<void> {
869860
return this.ctx.processCompletableEntry(
870861
WasmCommandType.CompletePromise,
871862
() => this.ctx.journalValueCodec.encode(this.serde.serialize(value as T)),
@@ -959,6 +950,7 @@ function completeCommandPromiseUsing<T>(
959950
}
960951
}
961952
} catch (e) {
953+
// eslint-disable-next-line @typescript-eslint/only-throw-error
962954
throw new AsyncCompleterError(e, commandType, commandIndex);
963955
}
964956

packages/restate-sdk/src/promises.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ abstract class AbstractRestatePromise<T> implements InternalRestatePromise<T> {
8181
onfulfilled?:
8282
| ((value: T) => TResult1 | PromiseLike<TResult1>)
8383
| null
84-
| undefined,
84+
,
8585
onrejected?:
8686
| ((reason: any) => TResult2 | PromiseLike<TResult2>)
8787
| null
88-
| undefined
88+
8989
): Promise<TResult1 | TResult2> {
9090
this.pollingPromise =
9191
this.pollingPromise ||
@@ -99,7 +99,7 @@ abstract class AbstractRestatePromise<T> implements InternalRestatePromise<T> {
9999
onrejected?:
100100
| ((reason: any) => TResult | PromiseLike<TResult>)
101101
| null
102-
| undefined
102+
103103
): Promise<T | TResult> {
104104
this.pollingPromise =
105105
this.pollingPromise ||
@@ -109,7 +109,7 @@ abstract class AbstractRestatePromise<T> implements InternalRestatePromise<T> {
109109
return this.publicPromiseOrCancelPromise().catch(onrejected);
110110
}
111111

112-
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
112+
finally(onfinally?: (() => void) | null ): Promise<T> {
113113
this.pollingPromise =
114114
this.pollingPromise ||
115115
this[RESTATE_CTX_SYMBOL].promisesExecutor
@@ -270,11 +270,11 @@ export class RestatePendingPromise<T> implements InternalRestatePromise<T> {
270270
onfulfilled?:
271271
| ((value: T) => TResult1 | PromiseLike<TResult1>)
272272
| null
273-
| undefined,
273+
,
274274
onrejected?:
275275
| ((reason: any) => TResult2 | PromiseLike<TResult2>)
276276
| null
277-
| undefined
277+
278278
): Promise<TResult1 | TResult2> {
279279
return pendingPromise<T>().then(onfulfilled, onrejected);
280280
}
@@ -283,12 +283,12 @@ export class RestatePendingPromise<T> implements InternalRestatePromise<T> {
283283
onrejected?:
284284
| ((reason: any) => TResult | PromiseLike<TResult>)
285285
| null
286-
| undefined
286+
287287
): Promise<T | TResult> {
288288
return pendingPromise<T>().catch(onrejected);
289289
}
290290

291-
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
291+
finally(onfinally?: (() => void) | null ): Promise<T> {
292292
return pendingPromise<T>().finally(onfinally);
293293
}
294294

0 commit comments

Comments
 (0)