From 489b3971d20b17b1d5086d328c832ad4a3a67414 Mon Sep 17 00:00:00 2001 From: panteliselef Date: Mon, 11 Dec 2023 21:52:31 +0200 Subject: [PATCH] fix(types): Avoid using `ts-expect-error` as it may fail for hosting apps --- .changeset/friendly-parrots-nail.md | 2 ++ packages/types/src/organizationMembership.ts | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .changeset/friendly-parrots-nail.md diff --git a/.changeset/friendly-parrots-nail.md b/.changeset/friendly-parrots-nail.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/friendly-parrots-nail.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/types/src/organizationMembership.ts b/packages/types/src/organizationMembership.ts index b8d6ea8235f..3d9770d2610 100644 --- a/packages/types/src/organizationMembership.ts +++ b/packages/types/src/organizationMembership.ts @@ -46,12 +46,12 @@ export interface OrganizationMembershipResource extends ClerkResource { } export type OrganizationCustomPermissionKey = 'permission' extends keyof ClerkAuthorization - ? // @ts-expect-error Typescript cannot infer the existence of the `permission` key even if we checking it above + ? // @ts-ignore Typescript cannot infer the existence of the `permission` key even if we checking it above ClerkAuthorization['permission'] : Base['permission']; export type OrganizationCustomRoleKey = 'role' extends keyof ClerkAuthorization - ? // @ts-expect-error Typescript cannot infer the existence of the `role` key even if we checking it above + ? // @ts-ignore Typescript cannot infer the existence of the `role` key even if we checking it above ClerkAuthorization['role'] : Base['role']; @@ -62,7 +62,7 @@ export type OrganizationCustomRoleKey = 'role' extends keyof ClerkAuthorization * these types will no longer match a developer's custom logic. */ export type MembershipRole = 'role' extends keyof ClerkAuthorization - ? // @ts-expect-error Typescript cannot infer the existence of the `role` key even if we checking it above + ? // @ts-ignore Typescript cannot infer the existence of the `role` key even if we checking it above // Disabling eslint rule because the error causes the type to become any when accessing a property that does not exist // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents ClerkAuthorization['role'] | 'admin' | 'basic_member' | 'guest_member' @@ -81,7 +81,7 @@ export type OrganizationSystemPermissionKey = * System permissions are only accessible from FAPI and client-side operations/utils */ export type OrganizationPermissionKey = 'permission' extends keyof ClerkAuthorization - ? // @ts-expect-error Typescript cannot infer the existence of the `permission` key even if we checking it above + ? // @ts-ignore Typescript cannot infer the existence of the `permission` key even if we checking it above // Disabling eslint rule because the error causes the type to become any when accessing a property that does not exist // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents ClerkAuthorization['permission'] | OrganizationSystemPermissionKey