Skip to content

Commit

Permalink
Stricter TypeScript (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
WarningImHack3r authored Aug 1, 2023
1 parent 93bdfc6 commit 98cd777
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@rgossiaux/svelte-headlessui": "^1.0.2",
"@sveltejs/adapter-static": "^2.0.2",
"@sveltejs/kit": "^1.21.0",
"@total-typescript/ts-reset": "^0.4.2",
"@types/node": "^20.2.5",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/reset.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@total-typescript/ts-reset";
6 changes: 4 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,12 @@
description={i("a11y.aria.radio-language")}
class="origin-bottom-right scale-75 xs:scale-90 sm:scale-100"
on:hover={async e => {
await loadResource(languages[e.detail.index]);
const lang = languages[e.detail.index];
lang ? await loadResource(lang) : console.warn(`Language ${lang} not found`);
}}
on:change={e => {
switchLanguage(languages[e.detail.index]);
const lang = languages[e.detail.index];
lang ? switchLanguage(lang) : console.error(`Language ${lang} not found`);
}}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
</em>
<div class="flex items-end justify-end">
<Button type="minimal" class="gap-2 text-end text-lg hover-child:translate-x-1">
{solutions.slice(-1)[0].description}
{solutions.slice(-1)[0]?.description ?? ""}
<ChevronRight class="h-4 w-4 transition-transform duration-500" />
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/sitemap.xml/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getRoutes(path: string) {
if (stats.isDirectory()) {
routes.push(...getRoutes(filePath));
} else if (file === "+page.svelte") {
const lastmod = stats.mtime.toISOString().split("T")[0];
const lastmod = stats.mtime.toISOString().split("T")[0] as string;
const path = filePath.replace("src/routes", "").replace("/+page.svelte", "");
routes.push({ path, lastMod: lastmod });
}
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "bundler",
"noUncheckedIndexedAccess": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
Expand Down

0 comments on commit 98cd777

Please sign in to comment.