diff --git a/frontend/.prettierignore b/frontend/.prettierignore index 962215c..111deed 100644 --- a/frontend/.prettierignore +++ b/frontend/.prettierignore @@ -1,3 +1,4 @@ dist public package-lock.json +src/routeTree.gen.ts diff --git a/frontend/CLAUDE.md b/frontend/CLAUDE.md index 6508131..d66e962 100644 --- a/frontend/CLAUDE.md +++ b/frontend/CLAUDE.md @@ -36,8 +36,9 @@ The sections below describe the existing code, which predates [PHILOSOPHY.md](PH React SPA in `frontend/src/`: +- Routing: TanStack Router, file-based under `src/routes/` — thin `.tsx` route files lazy-load the legacy pages. Search-param Zod schemas and the string-preserving `parseSearch`/`stringifySearch` (snapshot IDs must never be JSON-parsed) live in `shared/lib/searchParams.ts` - Pages: `GraphPage` (force-graph visualization), `MetadataPage`, `TimelinePage`, `FileTreePage`, `SnapshotSelectionPage`, `HomePage`, `DocsPage` -- `TableLayout.jsx` wraps all table-specific pages; `context/TableSpecsContext.jsx` shares table state +- `TableLayout.jsx` wraps all table-specific pages and provides graph data via `features/table/tableGraphData.ts`; `context/TableSpecsContext.jsx` shares table state - `graphConstants.js` defines node/link visual constants and `fileTypeLabel()` for human-readable node types - `uiTypography.js` — shared Tailwind class tokens for labels, body text, inputs, buttons, and toolbar controls - `layoutConstants.js` / `appConstants.js` — layout dimensions and app-wide constants diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index d93e1b3..495f146 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -43,7 +43,7 @@ const philosophyRules = { }; export default tseslint.config( - { ignores: ["dist", "public", "node_modules"] }, + { ignores: ["dist", "public", "node_modules", "src/routeTree.gen.ts"] }, // eslint-disable comments must carry a justification (PHILOSOPHY.md 'Tooling & enforcement') { @@ -85,6 +85,20 @@ export default tseslint.config( }, }, + // TanStack Router file routes: exporting `Route` and throwing redirect() + // are the router's own documented pattern — + // https://tanstack.com/router/latest/docs/framework/react/routing/file-based-routing + { + files: ["src/routes/**/*.tsx"], + rules: { + "react-refresh/only-export-components": [ + "error", + { allowExportNames: ["Route"] }, + ], + "@typescript-eslint/only-throw-error": "off", + }, + }, + // Component files: 200-line cap (lint-enforced per PHILOSOPHY.md) { files: ["**/*.tsx"], diff --git a/frontend/index.html b/frontend/index.html index be359aa..5d6075c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -9,6 +9,6 @@
- +