ui audit report

Guide for ui audit report

UI Projects Guardrails Audit Report

Date: 2026-01-12 Scope: loh-website, loh-ops-tools

1. Large Files (>300 Lines)

Status: 🔴 7 Violations in loh-website
Rule: Files must be under 300 lines to ensure modularity.
  • components/wiki/WikiComponents.tsx (548 lines) - Needs splitting into sub-components
  • app/store/page.tsx (485 lines) - Extract sections to components
  • pages/_app.tsx (377 lines) - Refactor providers/layouts
  • lib/wiki/renderer.tsx (353 lines) - Split rendering logic
  • components/FounderPacks.tsx (331 lines) - Extract individual pack cards
  • lib/shop-data.ts (323 lines) - Split data or move to JSON/DB
  • lib/wiki-data.ts (306 lines) - Split query logic
Note: lib/knowledge-base/items/index.ts (3249 lines) is generated code and is exempt.

2. TypeScript Safety (any Usage)

Status: 🟠 Warnings Found
Rule: Avoid any; use typed interfaces.

loh-website

  • lib/wiki-data.ts - Excessive use of any in database mapping.
    • const row: any = db.prepare(...)
    • options: any[] = []

loh-ops-tools

  • app/products/page.tsx
  • app/coupons/page.tsx
  • app/orders/page.tsx
  • lib/auth.tsx

3. Production Logs (console.log)

Status: 🟢 Clean ( mostly)
Rule: No console.log in production code.
  • Clean: No console.log found in loh-ops-tools components.
  • Clean: No console.log found in loh-website components (only in scripts/utils).

4. Hardcoded Colors

Status: 🟡 Review Needed
  • styles/osrs-wiki.css contains hardcoded colors. Should move to Tailwind config or CSS variables where possible to matching Design Bible.

Recommendations

  1. Refactor Large Files: Create pending_tasks.md entries to split the 7 identified large files.
  2. Strict Types: Add no-explicit-any ESLint rule to loh-ops-tools and fix reported files.
  3. Wiki Data: Create proper interfaces for SQLite results in wiki-data.ts.