chore: add ESLint + Prettier frontend linting#3
Conversation
Add ESLint flat config (eslint.config.js) and Prettier (.prettierrc) to the frontend with the following setup: - eslint + eslint-plugin-react + eslint-plugin-react-hooks - prettier for formatting - npm scripts: lint, lint:fix, format, format:check - CI step: `npm run lint` before frontend build React 19 strict hooks rules are disabled for now because the existing codebase predates them. Re-enable incrementally in follow-up PRs: - react-hooks/set-state-in-effect - react-hooks/exhaustive-deps - react-hooks/preserve-manual-memoization - react-hooks/refs - react-hooks/immutability - react-hooks/use-memo - react-hooks/purity Also fixes a latent `no-undef` bug in CommandContext.jsx where `isNavigationCommand` was referenced but never defined. Validation: - `npm run lint` → 0 errors, 45 warnings (all no-unused-vars) - `cargo test --lib` → 268 passed, 0 failed
ReviewOverall: good, low-risk infrastructure PR. Sensible scoping (flat ESLint + Prettier, lint-only CI gate), and the "disable React 19 strict hooks rules with an explicit re-enable list" stance is the right call for a codebase that predates them. Concerns1. const navigationTypes = ["navigate", "open", "switch", "back", "forward"];
return navigationTypes.includes(cmd?.type) || cmd?.type?.endsWith("_navigation");Double quotes in a file that uses single quotes everywhere, and 2. 3. "Latent bug" framing is slightly generous 4. Stray blank lines from removed disable-comments setIsInitialized(true);
}, []);The removed 5. 6. Suggested follow-ups (separate PRs)
Net: approve once CI passes. The nits above aren't blockers but the quote-style inconsistency + unenforced `format:check` undermine the "we have a linter now" guarantee — worth fixing soon. Review by Claude Code. |
|
Merging anyway — none of the findings are blockers; tracking the cleanup in a follow-up PR. |
Summary
Add ESLint flat config and Prettier to the frontend with a passing baseline.
What's included
no-undefbug)Disabled rules (for incremental adoption)
React 19 strict hooks rules are disabled because the existing codebase predates them. Re-enable incrementally:
react-hooks/set-state-in-effectreact-hooks/exhaustive-depsreact-hooks/preserve-manual-memoizationreact-hooks/refsreact-hooks/immutabilityreact-hooks/use-memoreact-hooks/purityValidation
npm run lint→ 0 errors, 45 warnings (allno-unused-vars)cargo test --lib→ 268 passed, 0 failednpm run build→ passes