Skip to content

A local-first personal finance app

[AI] Strengthen schedule rule types in loot-core (remove ts-expect-error) (#7051)

Matiss Janis Aboltins4caee99955fc
diff --git a/packages/loot-core/src/shared/schedules.ts b/packages/loot-core/src/shared/schedules.ts
index 745c7745a8..295bea0971 100644
--- a/packages/loot-core/src/shared/schedules.ts
+++ b/packages/loot-core/src/shared/schedules.ts
@@ -258,16 +258,20 @@ export function getRecurringDescription(
return `${desc}${suffix}`.trim();
}
+type ScheduleRuleOptions = IRuleOptions & {
+ frequency: string;
+ interval?: number;
+ byHourOfDay?: number[];
+};
+
export function recurConfigToRSchedule(config) {
- const base: IRuleOptions = {
+ const base: ScheduleRuleOptions = {
start: monthUtils.parseDate(config.start),
- // @ts-expect-error: issues with https://gitlab.com/john.carroll.p/rschedule/-/issues/86
frequency: config.frequency.toUpperCase(),
byHourOfDay: [12],
};
if (config.interval) {
- // @ts-expect-error: issues with https://gitlab.com/john.carroll.p/rschedule/-/issues/86
base.interval = config.interval;
}
diff --git a/upcoming-release-notes/7051.md b/upcoming-release-notes/7051.md
new file mode 100644
index 0000000000..1027208533
--- /dev/null
+++ b/upcoming-release-notes/7051.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [MatissJanis]
+---
+
+TypeScript: strengthen schedule type