Fix beta build: satisfy MessageContext hook deps.
Unit Tests / test (pull_request) Successful in 13s

CI=true turns the exhaustive-deps warnings into a failed build:beta on the deploy runner.
Closes #139.
This commit is contained in:
westfarn committed 2026-10-25 08:19:10 -05:00
1 parent ae59c2731d
commit 5fdc1377a0
2 files changed
+30 -7

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
---
description: Run ESLint with warnings as errors before pushing a merge request
alwaysApply: true
---
# ESLint before push
Beta deploy runs `npm run build:beta` with `CI=true`. Create React App turns ESLint warnings into build errors. Unit tests do not catch this. The failure shows up only on the deploy runner (`ai-server-4080`), where `CI=true` is set.
Before `git push` or opening a pull request that changes `llm-fe`:
1. From `llm-fe`, lint every changed file under `src` with warnings as errors:
```bash
CI=true ./node_modules/.bin/eslint --max-warnings 0 path/to/ChangedFile.tsx
```
2. Fix every warning in those files. Do not push while that command exits non-zero.
3. Do not set `DISABLE_ESLINT_PLUGIN` or `CI=false` to get the deploy through.
A full `eslint src` run reports warnings in files the production build does not compile. Those do not fail deploy. The gate is warnings in files the build compiles.
`react-hooks/exhaustive-deps` is the usual failure. Wrap the function in `useCallback` and list it in the dependency array. An empty dependency array that calls a component function fails the beta build.