Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 02c9f37

Browse files
committedAug 1, 2024
Fix linting errors
1 parent 73117f2 commit 02c9f37

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed
 

‎.eslintrc.cjs

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ module.exports = {
2626
},
2727
},
2828
},
29+
{
30+
// Apply to all test files. Proper type checking in tests with mocks can be tedious and counterproductive.
31+
files: ['**/*.test.ts', '**/*.spec.ts'],
32+
rules: {
33+
'@typescript-eslint/no-explicit-any': 'off'
34+
}
35+
}
2936
],
3037
env: {
3138
browser: true,

‎src/lib/emails/welcome_email_html.svelte

-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@
193193
style="font-family: Helvetica, sans-serif; font-size: 16px; vertical-align: top; border-radius: 4px; text-align: center; background-color: #0867ec;"
194194
valign="top"
195195
align="center"
196-
bgcolor="#0867ec"
197196
>
198197
<a
199198
href="https://github.com/CriticalMoments/CMSaasStarter"

‎src/routes/(admin)/account/api/+page.server.ts

+1
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export const actions = {
282282
company_name: companyName,
283283
website: website,
284284
updated_at: new Date(),
285+
unsubscribed: priorProfile?.unsubscribed ?? false,
285286
})
286287
.select()
287288

‎src/routes/(admin)/account/api/page.server.test.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ describe("toggleEmailSubscription", () => {
3333

3434
await expect(
3535
actions.toggleEmailSubscription({
36-
locals: { supabase: mockSupabase, safeGetSession: mockSafeGetSession },
37-
}),
36+
locals: {
37+
supabase: mockSupabase,
38+
safeGetSession: mockSafeGetSession,
39+
},
40+
} as any),
3841
).rejects.toThrow("Redirect")
3942

4043
expect(redirect).toHaveBeenCalledWith(303, "/login")
@@ -56,7 +59,7 @@ describe("toggleEmailSubscription", () => {
5659

5760
const result = await actions.toggleEmailSubscription({
5861
locals: { supabase: mockSupabase, safeGetSession: mockSafeGetSession },
59-
})
62+
} as any)
6063

6164
expect(mockSupabase.from).toHaveBeenCalledWith("profiles")
6265
expect(mockSupabase.select).toHaveBeenCalledWith("unsubscribed")
@@ -83,7 +86,7 @@ describe("toggleEmailSubscription", () => {
8386

8487
const result = await actions.toggleEmailSubscription({
8588
locals: { supabase: mockSupabase, safeGetSession: mockSafeGetSession },
86-
})
89+
} as any)
8790

8891
expect(mockSupabase.from).toHaveBeenCalledWith("profiles")
8992
expect(mockSupabase.select).toHaveBeenCalledWith("unsubscribed")
@@ -110,7 +113,7 @@ describe("toggleEmailSubscription", () => {
110113

111114
await actions.toggleEmailSubscription({
112115
locals: { supabase: mockSupabase, safeGetSession: mockSafeGetSession },
113-
})
116+
} as any)
114117

115118
// Check if fail was called with the correct arguments
116119
expect(fail).toHaveBeenCalledWith(500, {

‎tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"sourceMap": true,
1111
"strict": true,
1212
"types": ["vitest/globals"] // allows to skip import of test functions like `describe`, `it`, `expect`, etc.
13-
},
13+
}
1414
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
1515
//
1616
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes

‎vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export default defineConfig({
55
plugins: [sveltekit()],
66
test: {
77
include: ["src/**/*.{test,spec}.{js,ts}"],
8-
globals: true /// allows to skip import of test functions like `describe`, `it`, `expect`, etc.
8+
globals: true, /// allows to skip import of test functions like `describe`, `it`, `expect`, etc.
99
},
1010
})

0 commit comments

Comments
 (0)
Please sign in to comment.