fix: corrigir tipos e eliminar non-null assertions
Substitui non-null assertions (!) por type assertions ou optional chaining com guards. Troca any por unknown/tipos explícitos. - drizzle.config: DATABASE_URL! → as string - use-form-state: Record<string, any> → Record<string, unknown> - actions: catch (e: any) → catch (e), model tipado explicitamente - pagadores/data: row: any → Record<string, unknown> - note-dialog: result tipado explicitamente - bulk-import: payload as any removido - Map.get()! → optional chaining + guards em relatórios e dashboard Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -123,12 +123,16 @@ export async function fetchCategoryChartData(
|
||||
});
|
||||
}
|
||||
|
||||
categoryMap.get(categoryId)!.dataByPeriod.set(period, amount);
|
||||
categoryMap.get(categoryId)?.dataByPeriod.set(period, amount);
|
||||
}
|
||||
|
||||
const chartData = periods.map((period) => {
|
||||
const [year, month] = period.split("-");
|
||||
const date = new Date(Number.parseInt(year, 10), Number.parseInt(month, 10) - 1, 1);
|
||||
const date = new Date(
|
||||
Number.parseInt(year, 10),
|
||||
Number.parseInt(month, 10) - 1,
|
||||
1,
|
||||
);
|
||||
const monthLabel = format(date, "MMM", { locale: ptBR }).toUpperCase();
|
||||
|
||||
const dataPoint: { month: string; [key: string]: number | string } = {
|
||||
@@ -144,7 +148,11 @@ export async function fetchCategoryChartData(
|
||||
|
||||
const months = periods.map((period) => {
|
||||
const [year, month] = period.split("-");
|
||||
const date = new Date(Number.parseInt(year, 10), Number.parseInt(month, 10) - 1, 1);
|
||||
const date = new Date(
|
||||
Number.parseInt(year, 10),
|
||||
Number.parseInt(month, 10) - 1,
|
||||
1,
|
||||
);
|
||||
return format(date, "MMM", { locale: ptBR }).toUpperCase();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user