Skip to content

The Open Source DocuSign Alternative.

feat: promise safety with eslint

Mythie7811035384a7
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 000000000..f80dc7f80
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,7 @@
+# Config files
+*.config.js
+*.config.cjs
+
+# Statically hosted javascript files
+apps/*/public/*.js
+apps/*/public/*.cjs
diff --git a/apps/marketing/src/app/(marketing)/[content]/page.tsx b/apps/marketing/src/app/(marketing)/[content]/page.tsx
index f32765024..37d6d1b63 100644
--- a/apps/marketing/src/app/(marketing)/[content]/page.tsx
+++ b/apps/marketing/src/app/(marketing)/[content]/page.tsx
@@ -5,7 +5,7 @@ import { allDocuments } from 'contentlayer/generated';
import type { MDXComponents } from 'mdx/types';
import { useMDXComponent } from 'next-contentlayer/hooks';
-export const generateStaticParams = async () =>
+export const generateStaticParams = () =>
allDocuments.map((post) => ({ post: post._raw.flattenedPath }));
export const generateMetadata = ({ params }: { params: { content: string } }) => {
diff --git a/apps/marketing/src/app/(marketing)/blog/[post]/page.tsx b/apps/marketing/src/app/(marketing)/blog/[post]/page.tsx
index 68f22e734..5192dec32 100644
--- a/apps/marketing/src/app/(marketing)/blog/[post]/page.tsx
+++ b/apps/marketing/src/app/(marketing)/blog/[post]/page.tsx
@@ -7,7 +7,7 @@ import { ChevronLeft } from 'lucide-react';
import type { MDXComponents } from 'mdx/types';
import { useMDXComponent } from 'next-contentlayer/hooks';
-export const generateStaticParams = async () =>
+export const generateStaticParams = () =>
allBlogPosts.map((post) => ({ post: post._raw.flattenedPath }));
export const generateMetadata = ({ params }: { params: { post: string } }) => {
diff --git a/apps/marketing/src/app/(marketing)/open/page.tsx b/apps/marketing/src/app/(marketing)/open/page.tsx
index 539e624c6..2d5bc2aa4 100644
--- a/apps/marketing/src/app/(marketing)/open/page.tsx
+++ b/apps/marketing/src/app/(marketing)/open/page.tsx
@@ -43,7 +43,7 @@ export default async function OpenPage() {
accept: 'application/vnd.github.v3+json',
},
})
- .then((res) => res.json())
+ .then(async (res) => res.json())
.then((res) => ZGithubStatsResponse.parse(res));
const { total_count: mergedPullRequests } = await fetch(
@@ -54,7 +54,7 @@ export default async function OpenPage() {
},
},
)
- .then((res) => res.json())
+ .then(async (res) => res.json())
.then((res) => ZMergedPullRequestsResponse.parse(res));
const STARGAZERS_DATA = await fetch('https://stargrazer-live.onrender.com/api/stats', {
@@ -62,7 +62,7 @@ export default async function OpenPage() {
accept: 'application/json',
},
})
- .then((res) => res.json())
+ .then(async (res) => res.json())
.then((res) => ZStargazersLiveResponse.parse(res));
return (
diff --git a/apps/marketing/src/app/(marketing)/page.tsx b/apps/marketing/src/app/(marketing)/page.tsx
index 09e9e3dec..377384701 100644
--- a/apps/marketing/src/app/(marketing)/page.tsx
+++ b/apps/marketing/src/app/(marketing)/page.tsx
@@ -24,7 +24,7 @@ export default async function IndexPage() {
accept: 'application/vnd.github.v3+json',
},
})
- .then((res) => res.json())
+ .then(async (res) => res.json())
.then((res) => (typeof res.stargazers_count === 'number' ? res.stargazers_count : undefined))
.catch(() => undefined);
diff --git a/apps/marketing/src/components/(marketing)/claim-plan-dialog.tsx b/apps/marketing/src/components/(marketing)/claim-plan-dialog.tsx
index f350a7e01..7de30bba3 100644
--- a/apps/marketing/src/components/(marketing)/claim-plan-dialog.tsx
+++ b/apps/marketing/src/components/(marketing)/claim-plan-dialog.tsx
@@ -63,7 +63,9 @@ export const ClaimPlanDialog = ({ className, planId, children }: ClaimPlanDialog
const onFormSubmit = async ({ name, email }: TClaimPlanDialogFormSchema) => {
try {
- const delay = new Promise<void>((resolve) => setTimeout(resolve, 1000));
+ const delay = new Promise<void>((resolve) => {
+ setTimeout(resolve, 1000);
+ });
const [redirectUrl] = await Promise.all([
claimPlan({ name, email, planId, signatureText: name, signatureDataUrl: null }),
diff --git a/apps/marketing/src/components/(marketing)/password-reveal.tsx b/apps/marketing/src/components/(marketing)/password-reveal.tsx
index 7e1cb72a3..b31765943 100644
--- a/apps/marketing/src/components/(marketing)/password-reveal.tsx
+++ b/apps/marketing/src/components/(marketing)/password-reveal.tsx
@@ -13,7 +13,7 @@ export const PasswordReveal = ({ password }: PasswordRevealProps) => {
const [, copy] = useCopyToClipboard();
const onCopyClick = () => {
- copy(password).then(() => {
+ void copy(password).then(() => {
toast({
title: 'Copied to clipboard',
description: 'Your password has been copied to your clipboard.',
diff --git a/apps/marketing/src/components/(marketing)/widget.tsx b/apps/marketing/src/components/(marketing)/widget.tsx
index 1a15069e9..15e15d04c 100644
--- a/apps/marketing/src/components/(marketing)/widget.tsx
+++ b/apps/marketing/src/components/(marketing)/widget.tsx
@@ -124,7 +124,7 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
setValue('signatureDataUrl', draftSignatureDataUrl);
setValue('signatureText', '');
- trigger('signatureDataUrl');
+ void trigger('signatureDataUrl');
setShowSigningDialog(false);
};
@@ -135,7 +135,9 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
signatureText,
}: TWidgetFormSchema) => {
try {
- const delay = new Promise<void>((resolve) => setTimeout(resolve, 1000));
+ const delay = new Promise<void>((resolve) => {
+ setTimeout(resolve, 1000);
+ });
// eslint-disable-next-line turbo/no-undeclared-env-vars
const planId = process.env.NEXT_PUBLIC_STRIPE_COMMUNITY_PLAN_MONTHLY_PRICE_ID;
diff --git a/apps/web/src/app/(signing)/sign/[token]/name-field.tsx b/apps/web/src/app/(signing)/sign/[token]/name-field.tsx
index f200d94cd..9688619fa 100644
--- a/apps/web/src/app/(signing)/sign/[token]/name-field.tsx
+++ b/apps/web/src/app/(signing)/sign/[token]/name-field.tsx
@@ -149,7 +149,7 @@ export const NameField = ({ field, recipient }: NameFieldProps) => {
disabled={!localFullName}
onClick={() => {
setShowFullNameModal(false);
- onSign('local');
+ void onSign('local');
}}
>
Sign
diff --git a/apps/web/src/app/(signing)/sign/[token]/signature-field.tsx b/apps/web/src/app/(signing)/sign/[token]/signature-field.tsx
index bbc58b5e8..03fc40914 100644
--- a/apps/web/src/app/(signing)/sign/[token]/signature-field.tsx
+++ b/apps/web/src/app/(signing)/sign/[token]/signature-field.tsx
@@ -182,7 +182,7 @@ export const SignatureField = ({ field, recipient }: SignatureFieldProps) => {
disabled={!localSignature}
onClick={() => {
setShowSignatureModal(false);
- onSign('local');
+ void onSign('local');
}}
>
Sign
diff --git a/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx b/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx
index f7d14c39d..02af86d70 100644
--- a/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx
+++ b/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx
@@ -118,7 +118,7 @@ export const ProfileDropdown = ({ user }: ProfileDropdownProps) => {
<DropdownMenuItem
onSelect={() =>
- signOut({
+ void signOut({
callbackUrl: '/',
})
}
diff --git a/apps/web/src/components/(marketing)/claim-plan-dialog.tsx b/apps/web/src/components/(marketing)/claim-plan-dialog.tsx
index 06bfd5ced..1f78c5292 100644
--- a/apps/web/src/components/(marketing)/claim-plan-dialog.tsx
+++ b/apps/web/src/components/(marketing)/claim-plan-dialog.tsx
@@ -63,7 +63,9 @@ export const ClaimPlanDialog = ({ className, planId, children }: ClaimPlanDialog
const onFormSubmit = async ({ name, email }: TClaimPlanDialogFormSchema) => {
try {
- const delay = new Promise<void>((resolve) => setTimeout(resolve, 1000));
+ const delay = new Promise<void>((resolve) => {
+ setTimeout(resolve, 1000);
+ });
const [redirectUrl] = await Promise.all([
claimPlan({ name, email, planId, signatureText: name, signatureDataUrl: null }),
diff --git a/apps/web/src/components/(marketing)/password-reveal.tsx b/apps/web/src/components/(marketing)/password-reveal.tsx
index 7e1cb72a3..b31765943 100644
--- a/apps/web/src/components/(marketing)/password-reveal.tsx
+++ b/apps/web/src/components/(marketing)/password-reveal.tsx
@@ -13,7 +13,7 @@ export const PasswordReveal = ({ password }: PasswordRevealProps) => {
const [, copy] = useCopyToClipboard();
const onCopyClick = () => {
- copy(password).then(() => {
+ void copy(password).then(() => {
toast({
title: 'Copied to clipboard',
description: 'Your password has been copied to your clipboard.',
diff --git a/apps/web/src/components/(marketing)/widget.tsx b/apps/web/src/components/(marketing)/widget.tsx
index 1a15069e9..15e15d04c 100644
--- a/apps/web/src/components/(marketing)/widget.tsx
+++ b/apps/web/src/components/(marketing)/widget.tsx
@@ -124,7 +124,7 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
setValue('signatureDataUrl', draftSignatureDataUrl);
setValue('signatureText', '');
- trigger('signatureDataUrl');
+ void trigger('signatureDataUrl');
setShowSigningDialog(false);
};
@@ -135,7 +135,9 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
signatureText,
}: TWidgetFormSchema) => {
try {
- const delay = new Promise<void>((resolve) => setTimeout(resolve, 1000));
+ const delay = new Promise<void>((resolve) => {
+ setTimeout(resolve, 1000);
+ });
// eslint-disable-next-line turbo/no-undeclared-env-vars
const planId = process.env.NEXT_PUBLIC_STRIPE_COMMUNITY_PLAN_MONTHLY_PRICE_ID;
diff --git a/apps/web/src/components/forms/signin.tsx b/apps/web/src/components/forms/signin.tsx
index 5062515c8..ecf547f8b 100644
--- a/apps/web/src/components/forms/signin.tsx
+++ b/apps/web/src/components/forms/signin.tsx
@@ -79,10 +79,7 @@ export const SignInForm = ({ className }: SignInFormProps) => {
return (
<form
className={cn('flex w-full flex-col gap-y-4', className)}
- onSubmit={(e) => {
- e.preventDefault();
- handleSubmit(onFormSubmit)();
- }}
+ onSubmit={handleSubmit(onFormSubmit)}
>
<div>
<Label htmlFor="email" className="text-slate-500">
diff --git a/apps/web/src/helpers/get-feature-flag.ts b/apps/web/src/helpers/get-feature-flag.ts
index 67ab30397..cb97c9644 100644
--- a/apps/web/src/helpers/get-feature-flag.ts
+++ b/apps/web/src/helpers/get-feature-flag.ts
@@ -32,7 +32,7 @@ export const getFlag = async (
revalidate: 60,
},
})
- .then((res) => res.json())
+ .then(async (res) => res.json())
.then((res) => ZFeatureFlagValueSchema.parse(res))
.catch(() => false);
@@ -64,7 +64,7 @@ export const getAllFlags = async (
revalidate: 60,
},
})
- .then((res) => res.json())
+ .then(async (res) => res.json())
.then((res) => z.record(z.string(), ZFeatureFlagValueSchema).parse(res))
.catch(() => LOCAL_FEATURE_FLAGS);
};
diff --git a/apps/web/src/helpers/get-post-hog-server-client.ts b/apps/web/src/helpers/get-post-hog-server-client.ts
index c5670be8c..24d347faa 100644
--- a/apps/web/src/helpers/get-post-hog-server-client.ts
+++ b/apps/web/src/helpers/get-post-hog-server-client.ts
@@ -11,6 +11,6 @@ export default function PostHogServerClient() {
return new PostHog(postHogConfig.key, {
host: postHogConfig.host,
- fetch: (...args) => fetch(...args),
+ fetch: async (...args) => fetch(...args),
});
}
diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts
index 8c7405dbe..2f393ce71 100644
--- a/apps/web/src/middleware.ts
+++ b/apps/web/src/middleware.ts
@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from 'next/server';
-export default async function middleware(req: NextRequest) {
+export default function middleware(req: NextRequest) {
if (req.nextUrl.pathname === '/') {
const redirectUrl = new URL('/documents', req.url);
diff --git a/apps/web/src/pages/api/trpc/[trpc].ts b/apps/web/src/pages/api/trpc/[trpc].ts
index 1cd759201..bae4acc4c 100644
--- a/apps/web/src/pages/api/trpc/[trpc].ts
+++ b/apps/web/src/pages/api/trpc/[trpc].ts
@@ -4,7 +4,7 @@ import { appRouter } from '@documenso/trpc/server/router';
export default trpcNext.createNextApiHandler({
router: appRouter,
- createContext: ({ req, res }) => createTrpcContext({ req, res }),
+ createContext: async ({ req, res }) => createTrpcContext({ req, res }),
});
// export default async function handler(_req: NextApiRequest, res: NextApiResponse) {
diff --git a/apps/web/src/providers/feature-flag.tsx b/apps/web/src/providers/feature-flag.tsx
index 2bd9e1a3e..58d1bff63 100644
--- a/apps/web/src/providers/feature-flag.tsx
+++ b/apps/web/src/providers/feature-flag.tsx
@@ -67,7 +67,7 @@ export function FeatureFlagProvider({
const interval = setInterval(() => {
if (document.hasFocus()) {
- getAllFlags().then((newFlags) => setFlags(newFlags));
+ void getAllFlags().then((newFlags) => setFlags(newFlags));
}
}, FEATURE_FLAG_POLL_INTERVAL);
@@ -84,7 +84,7 @@ export function FeatureFlagProvider({
return;
}
- const onFocus = () => getAllFlags().then((newFlags) => setFlags(newFlags));
+ const onFocus = () => void getAllFlags().then((newFlags) => setFlags(newFlags));
window.addEventListener('focus', onFocus);
diff --git a/packages/email/transports/mailchannels.ts b/packages/email/transports/mailchannels.ts
index 3b49695b3..d00ef3198 100644
--- a/packages/email/transports/mailchannels.ts
+++ b/packages/email/transports/mailchannels.ts
@@ -110,9 +110,10 @@ export class MailChannelsTransport implements Transport<SentMessageInfo> {
});
}
- res.json().then((data) => {
- return callback(new Error(`MailChannels error: ${data.message}`), null);
- });
+ res
+ .json()
+ .then((data) => callback(new Error(`MailChannels error: ${data.message}`), null))
+ .catch((err) => callback(err, null));
})
.catch((err) => {
return callback(err, null);
diff --git a/packages/eslint-config/index.cjs b/packages/eslint-config/index.cjs
index eb2054c73..fcc6c878f 100644
--- a/packages/eslint-config/index.cjs
+++ b/packages/eslint-config/index.cjs
@@ -20,6 +20,8 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
+ tsconfigRootDir: __dirname,
+ project: ['../../apps/*/tsconfig.json', '../../packages/*/tsconfig.json'],
ecmaVersion: 2022,
ecmaFeatures: {
jsx: true,
@@ -33,6 +35,18 @@ module.exports = {
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
+ // Safety with promises so we aren't running with scissors
+ 'no-promise-executor-return': 'error',
+ 'prefer-promise-reject-errors': 'error',
+ 'require-atomic-updates': 'error',
+ '@typescript-eslint/no-floating-promises': 'error',
+ '@typescript-eslint/no-misused-promises': [
+ 'error',
+ { checksVoidReturn: { attributes: false } },
+ ],
+ '@typescript-eslint/promise-function-async': 'error',
+ '@typescript-eslint/require-await': 'error',
+
// We never want to use `as` but are required to on occasion to handle
// shortcomings in third-party and generated types.
//
diff --git a/packages/eslint-config/tsconfig.json b/packages/eslint-config/tsconfig.json
new file mode 100644
index 000000000..9035e41d6
--- /dev/null
+++ b/packages/eslint-config/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "@documenso/tsconfig/base.json",
+ "compilerOptions": {
+ "allowJs": true,
+ "noEmit": true,
+ },
+ "include": ["**/*.cjs", "**/*.js"],
+ "exclude": ["dist", "build", "node_modules"]
+}
diff --git a/packages/lib/next-auth/auth-options.ts b/packages/lib/next-auth/auth-options.ts
index 8166cda36..7417fbfc8 100644
--- a/packages/lib/next-auth/auth-options.ts
+++ b/packages/lib/next-auth/auth-options.ts
@@ -89,7 +89,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
};
},
- async session({ token, session }) {
+ session({ token, session }) {
if (token && token.email) {
return {
...session,
diff --git a/packages/lib/next-auth/get-server-session.ts b/packages/lib/next-auth/get-server-session.ts
index e1750b93d..56df8e7eb 100644
--- a/packages/lib/next-auth/get-server-session.ts
+++ b/packages/lib/next-auth/get-server-session.ts
@@ -1,9 +1,6 @@
import { GetServerSidePropsContext, NextApiRequest, NextApiResponse } from 'next';
-import { headers } from 'next/headers';
-import { NextRequest } from 'next/server';
import { getServerSession as getNextAuthServerSession } from 'next-auth';
-import { getToken } from 'next-auth/jwt';
import { prisma } from '@documenso/prisma';
@@ -30,18 +27,6 @@ export const getServerSession = async ({ req, res }: GetServerSessionOptions) =>
return user;
};
-export const getServerComponentToken = async () => {
- const requestHeaders = Object.fromEntries(headers().entries());
-
- const req = new NextRequest('http://example.com', {
- headers: requestHeaders,
- });
-
- const token = await getToken({
- req,
- });
-};
-
export const getServerComponentSession = async () => {
const session = await getNextAuthServerSession(NEXT_AUTH_OPTIONS);
diff --git a/packages/lib/server-only/document/complete-document-with-token.ts b/packages/lib/server-only/document/complete-document-with-token.ts
index e13436a62..2c937cf93 100644
--- a/packages/lib/server-only/document/complete-document-with-token.ts
+++ b/packages/lib/server-only/document/complete-document-with-token.ts
@@ -87,6 +87,6 @@ export const completeDocumentWithToken = async ({
if (documents.count > 0) {
console.log('sealing document');
- sealDocument({ documentId: document.id });
+ await sealDocument({ documentId: document.id });
}
};
diff --git a/packages/tailwind-config/tsconfig.json b/packages/tailwind-config/tsconfig.json
new file mode 100644
index 000000000..9035e41d6
--- /dev/null
+++ b/packages/tailwind-config/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "@documenso/tsconfig/base.json",
+ "compilerOptions": {
+ "allowJs": true,
+ "noEmit": true,
+ },
+ "include": ["**/*.cjs", "**/*.js"],
+ "exclude": ["dist", "build", "node_modules"]
+}
diff --git a/packages/trpc/server/trpc.ts b/packages/trpc/server/trpc.ts
index 9058f242e..91d2a239f 100644
--- a/packages/trpc/server/trpc.ts
+++ b/packages/trpc/server/trpc.ts
@@ -10,7 +10,7 @@ const t = initTRPC.context<TrpcContext>().create({
/**
* Middlewares
*/
-export const authenticatedMiddleware = t.middleware(({ ctx, next }) => {
+export const authenticatedMiddleware = t.middleware(async ({ ctx, next }) => {
if (!ctx.session) {
throw new TRPCError({
code: 'UNAUTHORIZED',
@@ -18,7 +18,7 @@ export const authenticatedMiddleware = t.middleware(({ ctx, next }) => {
});
}
- return next({
+ return await next({
ctx: {
...ctx,
diff --git a/packages/tsconfig/tsconfig.json b/packages/tsconfig/tsconfig.json
new file mode 100644
index 000000000..8b7637a27
--- /dev/null
+++ b/packages/tsconfig/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "extends": "./base.json",
+ "compilerOptions": {
+ "noEmit": true,
+ },
+ "include": ["**/*.ts", "**/*.tsx", "**/*.d.ts", "**/*.json"],
+ "exclude": ["dist", "build", "node_modules"]
+}
diff --git a/packages/ui/primitives/document-dropzone.tsx b/packages/ui/primitives/document-dropzone.tsx
index 10ccba9d0..8035e48cb 100644
--- a/packages/ui/primitives/document-dropzone.tsx
+++ b/packages/ui/primitives/document-dropzone.tsx
@@ -86,7 +86,7 @@ export const DocumentDropzone = ({ className, onDrop, ...props }: DocumentDropzo
multiple: false,
onDrop: ([acceptedFile]) => {
if (acceptedFile && onDrop) {
- onDrop(acceptedFile);
+ void onDrop(acceptedFile);
}
},
});
diff --git a/packages/ui/primitives/document-flow/add-fields.tsx b/packages/ui/primitives/document-flow/add-fields.tsx
index 36595e880..c56e91b49 100644
--- a/packages/ui/primitives/document-flow/add-fields.tsx
+++ b/packages/ui/primitives/document-flow/add-fields.tsx
@@ -88,6 +88,8 @@ export const AddFieldsFormPartial = ({
},
});
+ const onFormSubmit = handleSubmit(onSubmit);
+
const {
append,
remove,
@@ -500,7 +502,7 @@ export const AddFieldsFormPartial = ({
loading={isSubmitting}
disabled={isSubmitting}
onGoBackClick={documentFlow.onBackStep}
- onGoNextClick={() => handleSubmit(onSubmit)()}
+ onGoNextClick={() => void onFormSubmit()}
/>
</DocumentFlowFormContainerFooter>
</>
diff --git a/packages/ui/primitives/document-flow/add-signers.tsx b/packages/ui/primitives/document-flow/add-signers.tsx
index bda1bfbea..fe52627fd 100644
--- a/packages/ui/primitives/document-flow/add-signers.tsx
+++ b/packages/ui/primitives/document-flow/add-signers.tsx
@@ -68,6 +68,8 @@ export const AddSignersFormPartial = ({
},
});
+ const onFormSubmit = handleSubmit(onSubmit);
+
const {
append: appendSigner,
fields: signers,
@@ -214,7 +216,7 @@ export const AddSignersFormPartial = ({
loading={isSubmitting}
disabled={isSubmitting}
onGoBackClick={documentFlow.onBackStep}
- onGoNextClick={() => handleSubmit(onSubmit)()}
+ onGoNextClick={() => void onFormSubmit()}
/>
</DocumentFlowFormContainerFooter>
</>
diff --git a/packages/ui/primitives/document-flow/add-subject.tsx b/packages/ui/primitives/document-flow/add-subject.tsx
index b6e574e03..312a4eea2 100644
--- a/packages/ui/primitives/document-flow/add-subject.tsx
+++ b/packages/ui/primitives/document-flow/add-subject.tsx
@@ -47,6 +47,8 @@ export const AddSubjectFormPartial = ({
},
});
+ const onFormSubmit = handleSubmit(onSubmit);
+
return (
<>
<DocumentFlowFormContainerContent>
@@ -130,7 +132,7 @@ export const AddSubjectFormPartial = ({
disabled={isSubmitting}
goNextLabel={document.status === DocumentStatus.DRAFT ? 'Send' : 'Update'}
onGoBackClick={documentFlow.onBackStep}
- onGoNextClick={() => handleSubmit(onSubmit)()}
+ onGoNextClick={() => void onFormSubmit()}
/>
</DocumentFlowFormContainerFooter>
</>
diff --git a/packages/ui/primitives/pdf-viewer.tsx b/packages/ui/primitives/pdf-viewer.tsx
index 20c74969b..7315f1d26 100644
--- a/packages/ui/primitives/pdf-viewer.tsx
+++ b/packages/ui/primitives/pdf-viewer.tsx
@@ -66,7 +66,7 @@ export const PDFViewer = ({ className, document, onPageClick, ...props }: PDFVie
const pageY = event.clientY - top;
if (onPageClick) {
- onPageClick({
+ void onPageClick({
pageNumber,
numPages,
originalEvent: event,
diff --git a/packages/ui/primitives/signature-pad/canvas.ts b/packages/ui/primitives/signature-pad/canvas.ts
index ef573152a..2384147f0 100644
--- a/packages/ui/primitives/signature-pad/canvas.ts
+++ b/packages/ui/primitives/signature-pad/canvas.ts
@@ -302,8 +302,8 @@ export class Canvas {
/**
* Retrieves the signature as an image blob.
*/
- public toBlob(type?: string, quality?: number): Promise<Blob> {
- return new Promise((resolve, reject) => {
+ public async toBlob(type?: string, quality?: number): Promise<Blob> {
+ const promise = new Promise<Blob>((resolve, reject) => {
this.$canvas.toBlob(
(blob) => {
if (!blob) {
@@ -317,5 +317,7 @@ export class Canvas {
quality,
);
});
+
+ return await promise;
}
}