fix: resolve all 1008 svelte-check type errors across codebase
All checks were successful
CI / update (push) Successful in 1m54s

Add type annotations, JSDoc types, null checks, and proper generics
to eliminate all svelte-check errors. Key changes include:
- Type $state(null) variables to avoid 'never' inference
- Add JSDoc typedefs for plain <script> components
- Fix mongoose model typing with Model<any> to avoid union complexity
- Add App.Error/App.PageState interfaces in app.d.ts
- Fix tuple types to array types in types.ts
- Type catch block errors and API handler params
- Add null safety for DOM queries and optional chaining
- Add standard line-clamp property alongside -webkit- prefix
This commit is contained in:
2026-03-02 08:40:15 +01:00
parent 9e5fef1463
commit 4a931c7e30
125 changed files with 871 additions and 600 deletions

View File

@@ -175,4 +175,6 @@ const RecipeSchema = new mongoose.Schema(
RecipeSchema.index({ "translations.en.short_name": 1 });
RecipeSchema.index({ "translations.en.translationStatus": 1 });
export const Recipe = mongoose.model("Recipe", RecipeSchema);
let _recipeModel: any;
try { _recipeModel = mongoose.model("Recipe"); } catch { _recipeModel = mongoose.model("Recipe", RecipeSchema); }
export const Recipe = _recipeModel as mongoose.Model<any>;

View File

@@ -93,7 +93,7 @@ const RecurringPaymentSchema = new mongoose.Schema(
cronExpression: {
type: String,
validate: {
validator: function(value: string) {
validator: function(this: any, value: string) {
// Only validate if frequency is custom
if (this.frequency === 'custom') {
return value != null && value.trim().length > 0;

View File

@@ -9,4 +9,7 @@ const RosaryStreakSchema = new mongoose.Schema(
{ timestamps: true }
);
export const RosaryStreak = mongoose.models.RosaryStreak || mongoose.model("RosaryStreak", RosaryStreakSchema);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let _model: any;
try { _model = mongoose.model("RosaryStreak"); } catch { _model = mongoose.model("RosaryStreak", RosaryStreakSchema); }
export const RosaryStreak = _model as mongoose.Model<any>;