Skip to content

Commit f6ecf7f

Browse files
committed
fix(import-order): fix import order for all files by defining an eslint rule
1 parent 2369e30 commit f6ecf7f

186 files changed

Lines changed: 1811 additions & 630 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
{
2+
"plugins": ["prettier-plugin-svelte"],
23
"useTabs": false,
34
"singleQuote": true,
45
"trailingComma": "all",
56
"printWidth": 100,
67
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
},
714
{
815
"files": "*.json",
916
"options": {

apps/login-app/src/lib/server/redirect/redirect.effects.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@
77
*
88
**/
99

10-
import type { RequestEvent } from '@sveltejs/kit';
1110
import { z } from 'zod';
1211

12+
import { AM_DOMAIN_PATH } from '$core/constants';
13+
import { env } from '$env/dynamic/private';
1314
import {
14-
setHttpCookie,
15-
getHttpCookie,
16-
removeHttpCookie,
1715
amFetchRequest,
16+
getHttpCookie,
1817
getUserRolesFromSession,
18+
removeHttpCookie,
19+
setHttpCookie,
1920
} from '$server/sessions';
20-
import type { TokenId } from '$server/schemas';
21-
import { env } from '$env/dynamic/private';
22-
import { AM_DOMAIN_PATH } from '$core/constants';
23-
2421
import { parseRedirectForm } from './redirect.utilities';
22+
23+
import type { RequestEvent } from '@sveltejs/kit';
24+
2525
import type { RedirectData, RedirectParams } from './redirect.types';
26+
import type { TokenId } from '$server/schemas';
2627

2728
const REDIRECT_QUERY_PARAMS = 'redirect_query_params';
2829

apps/login-app/src/lib/server/redirect/redirect.utilities.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
import { describe, expect, it } from 'vitest';
1111

12-
import type { RedirectData } from './redirect.types';
13-
1412
import {
1513
isDefaultPath,
1614
parseRedirectForm,
1715
resolveAgainstOrigin,
1816
resolveRedirect,
1917
} from './redirect.utilities';
2018

19+
import type { RedirectData } from './redirect.types';
20+
2121
describe('parseRedirectForm', () => {
2222
it('parses expected values', () => {
2323
const formData = new FormData();

apps/login-app/src/lib/server/redirect/redirect.utilities.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
**/
99

1010
import { z } from 'zod';
11-
import { type RedirectData, type RedirectFormValue, type Resolver } from './redirect.types';
11+
1212
import { tokenIdSchema } from '$server/schemas';
1313

14+
import type { RedirectData, RedirectFormValue, Resolver } from './redirect.types';
15+
1416
/**
1517
* @function resolveRedirect - Resolves a final redirect URL from the provided context.
1618
* @param {RedirectData} redirectContext - The redirect context.

apps/login-app/src/lib/server/sessions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99

1010
import { v4 as uuid } from 'uuid';
1111
import { z } from 'zod';
12-
import type { Cookies } from '@sveltejs/kit';
12+
1313
import { AM_COOKIE_NAME, AM_DOMAIN_PATH, JSON_REALM_PATH } from '$core/constants';
1414

15+
import type { Cookies } from '@sveltejs/kit';
16+
1517
import type { TokenId } from '$server/schemas';
1618

1719
const amSessions: Map<string, string> = new Map();

apps/login-app/src/routes/(app)/+layout.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
**/
99

1010
import { env } from '$env/dynamic/private';
11+
1112
import type { LayoutServerLoad } from './$types';
1213

1314
export const load: LayoutServerLoad = () => ({

apps/login-app/src/routes/(app)/+layout.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
*
88
**/
99

10-
import configure from '$core/sdk.config';
10+
import '../../app.css';
11+
import { browser } from '$app/environment';
1112
import { setJourneyClientConfig } from '$core/journey-client.config';
12-
import { initialize as initializeJourneys } from '$journey/config.store';
1313
import { initialize as initializeLinks } from '$core/links.store';
14+
import configure from '$core/sdk.config';
15+
import { initialize as initializeJourneys } from '$journey/config.store';
1416

15-
import '../../app.css';
16-
import { browser } from '$app/environment';
1717
import type { LayoutLoad } from './$types';
1818

1919
export const load: LayoutLoad = ({ data }) => {

apps/login-app/src/routes/(app)/+page.server.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@
77
*
88
**/
99

10-
import { redirect, type RequestEvent } from '@sveltejs/kit';
11-
import type { PageServerLoad } from './$types';
12-
import { z } from 'zod';
10+
import { redirect } from '@sveltejs/kit';
1311

1412
import { getLocale } from '$core/_utilities/i18n.utilities';
15-
import { resolveRedirect } from '$server/redirect/redirect.utilities';
16-
17-
import type { stringsSchema } from '$core/locale.store';
1813
import {
19-
storeRedirectParams,
2014
createRedirectContext,
2115
readAndClearRedirectCookie,
16+
storeRedirectParams,
2217
} from '$server/redirect/redirect.effects';
18+
import { resolveRedirect } from '$server/redirect/redirect.utilities';
19+
20+
import type { RequestEvent } from '@sveltejs/kit';
21+
import type { z } from 'zod';
22+
23+
import type { PageServerLoad } from './$types';
24+
import type { stringsSchema } from '$core/locale.store';
2325

2426
export const load: PageServerLoad = async (event: RequestEvent) => {
2527
const userLocale = event.request.headers.get('accept-language') || 'en-US';

apps/login-app/src/routes/(app)/+page.svelte

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
-->
99

1010
<script lang="ts">
11-
import { goto } from '$app/navigation';
12-
import { page } from '$app/stores';
1311
import { onMount, tick } from 'svelte';
1412
13+
import { goto } from '$app/navigation';
14+
import { page } from '$app/stores';
1515
import Box from '$components/primitives/box/centered.svelte';
16-
import Journey from '$journey/journey.svelte';
17-
import { initialize as initializeJourney } from '$journey/journey.store';
1816
import { initialize as initializeContent } from '$core/locale.store';
17+
import { initialize as initializeJourney } from '$journey/journey.store';
18+
import Journey from '$journey/journey.svelte';
1919
2020
import type { JourneyStore } from '$journey/journey.interfaces';
2121
@@ -85,7 +85,8 @@
8585
journeyStepUrl =
8686
$journeyStore?.step?.payload?.detail?.failureUrl ??
8787
// Some failure flows store failureUrl in error.detail instead of step payload.
88-
$journeyStore?.error?.detail?.failureUrl ?? '';
88+
$journeyStore?.error?.detail?.failureUrl ??
89+
'';
8990
}
9091
9192
// wait until the DOM is updated before submitting
@@ -111,4 +112,4 @@
111112
{:else}
112113
<Journey componentStyle="app" displayIcon={true} {journeyStore} />
113114
{/if}
114-
</Box>
115+
</Box>

apps/login-app/src/routes/(app)/failure-redirect/+page.svelte

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88
-->
99

1010
<script lang="ts">
11-
import Box from '$components/primitives/box/centered.svelte';
12-
import ShieldIcon from '$components/icons/shield-icon.svelte';
11+
import ShieldIcon from '$components/icons/shield-icon.svelte';
12+
import Box from '$components/primitives/box/centered.svelte';
1313
</script>
1414

1515
<Box>
16-
<div class="tw_flex tw_flex-col tw_items-center tw_text-center tw_gap-4">
17-
<div class="tw_flex tw_justify-center">
18-
<ShieldIcon classes="tw_text-gray-400 tw_fill-current" size="72px" />
19-
</div>
16+
<div class="tw_flex tw_flex-col tw_items-center tw_text-center tw_gap-4">
17+
<div class="tw_flex tw_justify-center">
18+
<ShieldIcon classes="tw_text-gray-400 tw_fill-current" size="72px" />
19+
</div>
2020

21-
<h1 class="tw_primary-header dark:tw_primary-header_dark">Sign-in failed</h1>
22-
<p class="tw_text-secondary-dark dark:tw_text-secondary-light">
23-
We couldn’t redirect you automatically.
24-
</p>
25-
<p class="tw_text-secondary-dark dark:tw_text-secondary-light">
26-
Return to the application and try signing in again.
27-
</p>
28-
</div>
21+
<h1 class="tw_primary-header dark:tw_primary-header_dark">Sign-in failed</h1>
22+
<p class="tw_text-secondary-dark dark:tw_text-secondary-light">
23+
We couldn’t redirect you automatically.
24+
</p>
25+
<p class="tw_text-secondary-dark dark:tw_text-secondary-light">
26+
Return to the application and try signing in again.
27+
</p>
28+
</div>
2929
</Box>

0 commit comments

Comments
 (0)