Skip to content

Commit dadebc2

Browse files
chore(ui): fix eslint errors in composed and profile modules (#9242)
1 parent e657593 commit dadebc2

14 files changed

Lines changed: 34 additions & 21 deletions

.changeset/fix-ui-lint.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/ui/src/components/ConfigureSSO/domain/__tests__/organizationEnterpriseConnection.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ describe('connectionBackingEmail', () => {
288288
const email = (id: string, status: 'verified' | 'unverified'): EmailAddressResource =>
289289
({ id, emailAddress: `${id}@acme.com`, verification: { status } }) as EmailAddressResource;
290290

291-
const makeUser = (overrides: Partial<UserResource>): UserResource => overrides as UserResource;
291+
const makeUser = (overrides: Partial<UserResource>): UserResource => overrides;
292292

293293
it('returns the primary email when one is present', () => {
294294
const primary = email('primary', 'verified');

packages/ui/src/components/UserProfile/SecurityPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ProfileCard } from '@/ui/elements/ProfileCard';
33

44
import { localizationKeys } from '../../customizables';
55
import { ActiveDevicesSection } from './ActiveDevicesSection';
6-
import { SecurityPassword, SecurityPasskeys, SecurityMfa, SecurityDelete } from './SecuritySections';
6+
import { SecurityDelete, SecurityMfa, SecurityPasskeys, SecurityPassword } from './SecuritySections';
77

88
export const SecurityPage = withCardStateProvider(() => {
99
const card = useCardState();

packages/ui/src/components/UserProfile/SecuritySections.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ import type { ReactNode } from 'react';
44
import { getSecondFactors } from '@/ui/utils/mfa';
55

66
import { useEnvironment, useUserProfileContext } from '../../contexts';
7+
import { DeleteSection } from './DeleteSection';
78
import { MfaSection } from './MfaSection';
89
import { PasskeySection } from './PasskeySection';
910
import { PasswordSection } from './PasswordSection';
10-
import { DeleteSection } from './DeleteSection';
1111

1212
export function SecurityPassword(): ReactNode {
1313
const { instanceIsPasswordBased } = useEnvironment().userSettings;
1414

15-
if (!instanceIsPasswordBased) return null;
15+
if (!instanceIsPasswordBased) {
16+
return null;
17+
}
1618

1719
return <PasswordSection />;
1820
}
@@ -21,23 +23,29 @@ export function SecurityPasskeys(): ReactNode {
2123
const { attributes } = useEnvironment().userSettings;
2224
const { shouldAllowIdentificationCreation } = useUserProfileContext();
2325

24-
if (!attributes.passkey?.enabled || !shouldAllowIdentificationCreation) return null;
26+
if (!attributes.passkey?.enabled || !shouldAllowIdentificationCreation) {
27+
return null;
28+
}
2529

2630
return <PasskeySection />;
2731
}
2832

2933
export function SecurityMfa(): ReactNode {
3034
const { attributes } = useEnvironment().userSettings;
3135

32-
if (getSecondFactors(attributes).length === 0) return null;
36+
if (getSecondFactors(attributes).length === 0) {
37+
return null;
38+
}
3339

3440
return <MfaSection />;
3541
}
3642

3743
export function SecurityDelete(): ReactNode {
3844
const { user } = useUser();
3945

40-
if (!user?.deleteSelfEnabled) return null;
46+
if (!user?.deleteSelfEnabled) {
47+
return null;
48+
}
4149

4250
return <DeleteSection />;
4351
}

packages/ui/src/components/UserProfile/__tests__/ConnectedAccountsSection.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ describe('ConnectedAccountsSection ', () => {
168168
open,
169169
},
170170
});
171-
const reload = vi.spyOn(fixtures.clerk.user!, 'reload').mockResolvedValue(fixtures.clerk.user!);
171+
const reload = vi.spyOn(fixtures.clerk.user, 'reload').mockResolvedValue(fixtures.clerk.user);
172172
fixtures.clerk.user?.createExternalAccount.mockResolvedValue({
173173
verification: { externalVerificationRedirectURL: new URL('https://provider.example/auth') },
174174
} as ExternalAccountResource);
@@ -291,7 +291,7 @@ describe('ConnectedAccountsSection ', () => {
291291
open,
292292
},
293293
});
294-
const reload = vi.spyOn(fixtures.clerk.user!, 'reload').mockResolvedValue(fixtures.clerk.user!);
294+
const reload = vi.spyOn(fixtures.clerk.user, 'reload').mockResolvedValue(fixtures.clerk.user);
295295
fixtures.clerk.user?.createExternalAccount.mockResolvedValue({
296296
verification: { externalVerificationRedirectURL: new URL('https://provider.example/auth') },
297297
} as ExternalAccountResource);

packages/ui/src/components/UserProfile/__tests__/SecuritySections.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { render, screen } from '@/test/utils';
55
import { CardStateProvider } from '@/ui/elements/contexts';
66

77
import { clearFetchCache } from '../../../hooks';
8-
import { SecurityPassword, SecurityPasskeys, SecurityMfa, SecurityDelete } from '../SecuritySections';
8+
import { SecurityDelete, SecurityMfa, SecurityPasskeys, SecurityPassword } from '../SecuritySections';
99

1010
const { createFixtures } = bindCreateFixtures('UserProfile');
1111

packages/ui/src/composed/APIKeysSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { Suspense, type ComponentType, type ReactNode } from 'react';
3+
import { type ComponentType, type ReactNode, Suspense } from 'react';
44

55
import { CardStateProvider } from '../elements/contexts';
66

packages/ui/src/composed/BillingSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { Suspense, type ComponentType, type ReactNode } from 'react';
3+
import { type ComponentType, type ReactNode, Suspense } from 'react';
44

55
import { RouteContext } from '../router/RouteContext';
66
import { useBillingRouter } from './useBillingRouter';

packages/ui/src/composed/__tests__/OrganizationProfile.test.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import type { ClerkPaginatedResponse, OrganizationMembershipResource } from '@clerk/shared/types';
2-
import { describe, expect, it } from 'vitest';
1+
import { describe, it } from 'vitest';
32

43
import { bindCreateFixtures } from '@/test/create-fixtures';
5-
import { render, screen, waitFor } from '@/test/utils';
4+
import { render, screen } from '@/test/utils';
65

76
import { OrganizationGeneralPage } from '../../components/OrganizationProfile/OrganizationGeneralPage';
87

packages/ui/src/composed/__tests__/stub-limitations.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderHook, act } from '@testing-library/react';
1+
import { act, renderHook } from '@testing-library/react';
22
import { afterEach, describe, expect, it, vi } from 'vitest';
33

44
import { createComposedRouter, stubRouter } from '../stubRouter';

0 commit comments

Comments
 (0)