Skip to content

Commit 169e13d

Browse files
committed
Fix TypeScript errors and warnings
1 parent 599e9d8 commit 169e13d

49 files changed

Lines changed: 68 additions & 1676 deletions

Some content is hidden

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

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
"tslib": "2.8.1",
174174
"typescript": "5.9.3",
175175
"typescript-eslint": "8.46.1",
176+
"unist-util-inspect": "^8.1.0",
176177
"unist-util-visit": "^5.0.0",
177178
"vitest": "3.2.4",
178179
"vitest-axe": "0.1.0"

scripts/build/favicon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { writeFile } from 'fs/promises'
2525
type IconGenerator = (options: Metadata) => Promise<Buffer>
2626

2727
const faviconPath = `src/assets/favicon.svg`
28-
const generateIcoFavicon: IconGenerator = ({ width, height, density }) => {
28+
const generateIcoFavicon: IconGenerator = async ({ width, height, density }) => {
2929
if (!width || !height || !density)
3030
throw new Error(`Required option not passed to generateIcoFavicon`)
3131
const faviconDimensions = [32, 64]

src/components/CallToAction/Newsletter/__tests__/client.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('NewsletterForm class works', () => {
149149
elements.emailInput.value = 'test@example.com'
150150
elements.consentCheckbox.checked = true
151151
const submitEvent = new Event('submit')
152-
await elements.form.dispatchEvent(submitEvent)
152+
elements.form.dispatchEvent(submitEvent)
153153

154154
// Wait for async operations
155155
await vi.runAllTimersAsync()
@@ -180,7 +180,7 @@ describe('NewsletterForm class works', () => {
180180
elements.emailInput.value = 'test@example.com'
181181
elements.consentCheckbox.checked = true
182182
const submitEvent = new Event('submit')
183-
await elements.form.dispatchEvent(submitEvent)
183+
elements.form.dispatchEvent(submitEvent)
184184

185185
// Wait for async operations
186186
await vi.runAllTimersAsync()
@@ -202,7 +202,7 @@ describe('NewsletterForm class works', () => {
202202
elements.emailInput.value = 'test@example.com'
203203
elements.consentCheckbox.checked = true
204204
const submitEvent = new Event('submit')
205-
await elements.form.dispatchEvent(submitEvent)
205+
elements.form.dispatchEvent(submitEvent)
206206

207207
// Wait for async operations
208208
await vi.runAllTimersAsync()

src/components/Cookies/Customize/__tests__/client.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ Object.defineProperty(document, 'cookie', {
3030
})
3131

3232
// Mock DOM elements
33-
const mockElement = (id: string, checked = false) =>
34-
({
35-
id,
36-
checked,
37-
addEventListener: vi.fn(),
38-
style: {},
39-
}) as unknown as HTMLInputElement
40-
4133
const mockButton = (id: string): HTMLButtonElement => {
4234
const button = document.createElement('button')
4335
button.id = id

src/components/GDPR/Consent/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ const purposeList = purposes.map(p => purposeDescriptions[p] || p)
120120
if (!checkbox) return
121121

122122
const purposes = JSON.parse(
123-
container.dataset.purposes || '[]'
123+
container.dataset['purposes'] || '[]'
124124
) as ConsentPurpose[]
125-
const formId = container.dataset.formId
125+
const formId = container.dataset['formId']
126126

127127
initGDPRConsent(checkbox.id, purposes, formId)
128128
})

src/components/Hero/@types/image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ export interface ImageProps {
88
image?: {
99
src: ImageMetadata
1010
alt: string
11-
}
11+
} | undefined
1212
}

src/components/Hero/__tests__/client.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest'
1+
import { describe, it, expect, beforeEach, vi, afterEach, type Mock } from 'vitest'
22
import { JSDOM } from 'jsdom'
33
import { readFileSync } from 'fs'
44
import { resolve } from 'path'
@@ -82,7 +82,7 @@ describe('HeroLoader', () => {
8282
})
8383

8484
it('should register with loader', () => {
85-
;(registerScript as vi.Mock).mockClear()
85+
;(registerScript as Mock).mockClear()
8686
registerScript(HeroLoader)
8787
expect(registerScript).toHaveBeenCalledWith(HeroLoader)
8888
})

src/components/Hero/client.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ export class HeroLoader extends LoadableScript {
138138
},
139139
'-=1'
140140
)
141-
.staggerFrom(
141+
.from(
142142
'.monitorContentGroup path',
143-
1,
144143
{
144+
duration: 1,
145145
scaleX: 0,
146-
},
147-
0.1
146+
stagger: 0.1,
147+
}
148148
)
149149
.from('.monitorLogo', {
150150
scale: 0,
@@ -248,13 +248,13 @@ export class HeroLoader extends LoadableScript {
248248
},
249249
'-=2'
250250
)
251-
.staggerFrom(
251+
.from(
252252
'.laptopContentGroup path',
253-
1,
254253
{
254+
duration: 1,
255255
scaleX: 0,
256-
},
257-
0.1
256+
stagger: 0.1,
257+
}
258258
)
259259
.to('.laptopTrackpad', {
260260
duration: 0.3,
@@ -322,12 +322,13 @@ export class HeroLoader extends LoadableScript {
322322
delay: 2,
323323
ease: Anticipate.out,
324324
})
325-
.staggerFrom(
325+
.from(
326326
['.tabletButton', '.tabletCamera'],
327-
0.5,
328327
{
328+
duration: 0.5,
329329
scale: 0,
330330
ease: 'back',
331+
stagger: 0,
331332
},
332333
'-=1'
333334
)
@@ -375,14 +376,14 @@ export class HeroLoader extends LoadableScript {
375376
.set(['.tabletGroup', '.tabletContentGroup'], {
376377
alpha: 0,
377378
})
378-
.staggerFrom(
379+
.from(
379380
['.phoneButton', '.phoneCamera', '.phoneSpeaker'],
380-
1,
381381
{
382+
duration: 1,
382383
scale: 0,
383384
ease: 'back',
384-
},
385-
0.1
385+
stagger: 0.1,
386+
}
386387
)
387388
.to('.phoneGroup', {
388389
duration: 2,

src/components/Hero/home/image.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import heroSvg from '@assets/images/site/hero.svg?raw'
1212
</div>
1313
</div>
1414

15-
<script type="module">
15+
<script>
1616
import { registerScript } from '../../Scripts/loader'
1717
import { HeroLoader } from '../client'
1818

0 commit comments

Comments
 (0)