generated from nhcarrigan/template
fix: resolve pre-existing TypeScript strictness build errors
- Add @types/node to API devDependencies
- Create HonoEnv type and apply to all routers + auth middleware for
proper context.get/set("discordId") typing
- Use conditional spreads for exactOptionalPropertyTypes dailyChallenges
in GameContext, tick engine, and prestige route
- Use conditional spread for optional signature in SaveRequest calls
- Add non-null assertions in shuffle/template index for noUncheckedIndexedAccess
- Cast GameState to never for Prisma InputJsonValue fields
- Exclude vite.config.ts from web tsconfig (it runs in Node context)
This commit is contained in:
@@ -174,7 +174,7 @@ export const GameProvider = ({ children }: { children: React.ReactNode }): React
|
||||
if (stateRef.current && !isSyncingRef.current) {
|
||||
void saveGame({
|
||||
state: stateRef.current,
|
||||
signature: signatureRef.current ?? undefined,
|
||||
...(signatureRef.current !== null ? { signature: signatureRef.current } : {}),
|
||||
}).then((response) => {
|
||||
setLastSavedAt(response.savedAt);
|
||||
if (response.signature) {
|
||||
@@ -222,7 +222,7 @@ export const GameProvider = ({ children }: { children: React.ReactNode }): React
|
||||
try {
|
||||
const response = await saveGame({
|
||||
state: stateRef.current,
|
||||
signature: signatureRef.current ?? undefined,
|
||||
...(signatureRef.current !== null ? { signature: signatureRef.current } : {}),
|
||||
});
|
||||
setSyncError(null);
|
||||
setLastSavedAt(response.savedAt);
|
||||
@@ -267,7 +267,7 @@ export const GameProvider = ({ children }: { children: React.ReactNode }): React
|
||||
totalGoldEarned: prev.player.totalGoldEarned + clickPower,
|
||||
totalClicks: prev.player.totalClicks + 1,
|
||||
},
|
||||
dailyChallenges: updatedDailyChallenges,
|
||||
...(updatedDailyChallenges !== undefined ? { dailyChallenges: updatedDailyChallenges } : {}),
|
||||
};
|
||||
});
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user