Files
accounted/scripts/checks/antipatterns-baseline.json
T
9a56b7aff9 perf(bookkeeping): fiscal-year pickers and cash accounts read the session cache (#1934)
First consumer migration onto lib/reference-data. FyPicker and
FiscalYearSelector (14 consumer surfaces, 47 fiscal-period fetch sites
before this series) now read useFiscalPeriods(); with the layout seed the
restore of the persisted scope runs in the first effect tick and onReady
fires on mount instead of after a round trip. Their restore rules are
extracted into a pure resolveInitialFiscalScope() (lib/reference-data/
fiscal-scope.ts) so the two pickers cannot drift apart again, and the
restore runs once per company load, not on every background revalidation.

- /reports: the static catalog renders immediately; only the "no fiscal
  year" empty state waits for the picker (previously six skeleton bars
  until /api/bookkeeping/fiscal-periods resolved).
- JournalEntryList (/bookkeeping): resolves its initial scope from the
  cached list instead of its own fetch; the saved-scope shortcut still
  unblocks the entries fetch first when nothing is cached, and resolution
  is guarded to once per company so a revalidation can never snap a
  deep-link "all years" visit back to the stored year.
- /transactions: the account chooser reads useCashAccounts({ enabledOnly })
  (seeded) instead of fetching /api/cash-accounts on every visit; the bank
  sync button invalidates that entry after a sync.
- STORAGE_KEY_PREFIX / ALL_YEARS_VALUE move to a dependency-free
  fiscal-year-storage.ts (re-exported from FiscalYearSelector) so lib/ code
  can import them without a React component.

raw-reference-fetch ratchet: 55 -> 51 files.

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-26 14:24:24 +02:00

93 lines
3.9 KiB
JSON

{
"_comment": "Ratchet baseline for scripts/checks/no-new-antipatterns.mjs. These counts may only decrease. Re-run with --update after a migration lowers them. Goal: both reach 0 (A1 route-auth campaign, D1 rounding codemod).",
"rawRouteAuth": {
"count": 1,
"files": [
"app/api/mcp-oauth/authorize/route.ts"
]
},
"naiveOreRound": {
"count": 622
},
"handRolledInvariants": {
"count": 115
},
"ledgerScanningReports": {
"count": 4,
"files": [
"lib/bokslut/assets/asset-service.ts",
"lib/bokslut/reserves/periodiseringsfond-service.ts",
"lib/bokslut/tax-provision/bolagsskatt-calculator.ts",
"lib/bokslut/tax-provision/sarskild-loneskatt-calculator.ts"
]
},
"dialogOverflowRisk": {
"count": 7,
"files": [
"app/(dashboard)/supplier-invoices/[id]/page.tsx",
"components/bookkeeping/JournalEntryForm.tsx",
"components/invoices/PaymentBookingDialog.tsx",
"components/invoices/SendInvoiceDialog.tsx",
"components/reports/views/index.tsx",
"components/salary/NewEmployeeDialog.tsx",
"components/transactions/InvoiceMatchDialog.tsx"
]
},
"rawReferenceFetch": {
"count": 51,
"files": [
"app/(dashboard)/assets/[id]/dispose/page.tsx",
"app/(dashboard)/bookkeeping/year-end/page.tsx",
"app/(dashboard)/bookkeeping/year-end/periodisering/page.tsx",
"app/(dashboard)/customers/page.tsx",
"app/(dashboard)/import/page.tsx",
"app/(dashboard)/invoices/[id]/page.tsx",
"app/(dashboard)/invoices/page.tsx",
"app/(dashboard)/pending/page.tsx",
"app/(dashboard)/salary/employees/[id]/page.tsx",
"app/(dashboard)/salary/runs/[id]/page.tsx",
"app/(dashboard)/supplier-invoices/[id]/page.tsx",
"components/articles/ArticleForm.tsx",
"components/bookkeeping/BookingTemplatePicker.tsx",
"components/bookkeeping/ChartOfAccounts.tsx",
"components/bookkeeping/ChartOfAccountsManager.tsx",
"components/bookkeeping/CorrectionEntryDialog.tsx",
"components/bookkeeping/EditAccountDialog.tsx",
"components/bookkeeping/JournalEntryForm.tsx",
"components/bookkeeping/StrikeLinesDialog.tsx",
"components/bookkeeping/TemplateBookDialog.tsx",
"components/common/CashAccountSelector.tsx",
"components/dimensions/types.ts",
"components/extensions/general/ArcimMigrationWorkspace.tsx",
"components/extensions/general/BookDirectlyDialog.tsx",
"components/extensions/general/InvoiceInboxWorkspace.tsx",
"components/extensions/general/TicWorkspace.tsx",
"components/import/BankFileConfirmStep.tsx",
"components/import/FiscalYearGapNotice.tsx",
"components/import/ImportReviewStep.tsx",
"components/import/OpeningBalancePeriodStep.tsx",
"components/invoices/InvoiceEditor.tsx",
"components/invoices/PaymentBookingDialog.tsx",
"components/invoices/SendInvoiceDialog.tsx",
"components/pending-operations/use-account-names.ts",
"components/reports/SkatteverketPanel.tsx",
"components/reports/views/index.tsx",
"components/salary/NewEmployeeDialog.tsx",
"components/settings/BookingTemplatesPanel.tsx",
"components/settings/FiscalPeriodEditor.tsx",
"components/settings/FiscalYearsManager.tsx",
"components/settings/InvoicePaymentAccountsSettings.tsx",
"components/supplier-invoices/use-supplier-invoice-data.ts",
"components/suppliers/SupplierForm.tsx",
"components/transactions/BulkBookDialog.tsx",
"components/transactions/DuplicateBookingDialog.tsx",
"components/transactions/InvoiceMatchDialog.tsx",
"components/transactions/MatchVoucherDialog.tsx",
"components/transactions/QuickReviewDialog.tsx",
"components/transactions/TemplatePicker.tsx",
"components/transactions/TransactionBookingDialog.tsx",
"extensions/general/enable-banking/components/AccountPickerDialog.tsx"
]
}
}