adapt typescript to strict mode

This commit is contained in:
imperosol
2026-07-13 12:03:38 +02:00
parent 448e67738e
commit ac8a79468e
40 changed files with 386 additions and 242 deletions
+3 -5
View File
@@ -8,7 +8,7 @@ import {
type Rollup,
type UserConfig,
} from "vite";
import tsconfig from "./tsconfig.json";
import { compilerOptions } from "./tsconfig.bundled.json";
const outDir = resolve(__dirname, "./staticfiles/generated/bundled");
const collectedFiles = glob.sync(
@@ -20,7 +20,7 @@ const collectedFiles = glob.sync(
**/
function getAliases(): AliasOptions {
const aliases: AliasOptions = {};
for (const [key, value] of Object.entries(tsconfig.compilerOptions.paths)) {
for (const [key, value] of Object.entries(compilerOptions.paths)) {
aliases[key] = resolve(__dirname, value[0]);
}
return aliases;
@@ -59,7 +59,7 @@ export default defineConfig((config: UserConfig) => {
// Mirror architecture of static folders in generated .js and .css
entryFileNames: (chunkInfo: Rollup.PreRenderedChunk) => {
if (chunkInfo.facadeModuleId !== null) {
return `${getRelativeAssetPath(chunkInfo.facadeModuleId)}.[hash].js`;
return `${getRelativeAssetPath(chunkInfo.facadeModuleId as string)}.[hash].js`;
}
return "[name].[hash].js";
},
@@ -80,8 +80,6 @@ export default defineConfig((config: UserConfig) => {
resolve: {
alias: getAliases(),
},
// biome-ignore lint/style/useNamingConvention: that's how it's called
inject: { Alpine: "alpinejs", htmx: "htmx.org" },
plugins: [visualizer({ filename: ".bundle-size-report.html" }) as PluginOption],
} satisfies UserConfig;
});