Fix lint CI failures: prettier formatting and react-hooks/set-state-in-effect errors - #20
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
essentialsx-website | 6d91ed3 | Jul 27 2026, 04:21 AM |
…le in dump/page.tsx
Copilot
AI
changed the title
[WIP] Fix the failing GitHub Actions job lint
Fix lint CI failures: prettier formatting and react-hooks/set-state-in-effect errors
Jul 27, 2026
JRoy
approved these changes
Jul 27, 2026
There was a problem hiding this comment.
Pull request overview
This PR addresses failing lint CI by applying Prettier-compliant formatting in Next.js redirect config and suppressing React Compiler ESLint react-hooks/set-state-in-effect findings for intentional mount-time state updates / async bootstrap effects.
Changes:
- Reformat long redirect entries in
next.config.tsto satisfyprettier/prettierprint width constraints. - Add targeted
react-hooks/set-state-in-effectsuppressions in components and shared data bootstrap logic to unblock React Compiler ESLint. - Adjust types in
cloudflare-env.d.ts(but the current change may reintroduce lint issues).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| next.config.ts | Expands redirect objects to multi-line formatting to satisfy Prettier. |
| contexts/shared-data.tsx | Disables react-hooks/set-state-in-effect for the bootstrap effect that triggers async state updates. |
| components/footer.tsx | Suppresses react-hooks/set-state-in-effect for theme initialization from localStorage. |
| components/BetaBanner.tsx | Suppresses react-hooks/set-state-in-effect for initial banner visibility derived from localStorage. |
| app/dump/page.tsx | Suppresses react-hooks/set-state-in-effect for one effect-triggered fetch (but not the other). |
| cloudflare-env.d.ts | Modifies AI Gateway types; currently leaves trailing whitespace and may reintroduce redundant-union lint errors. |
Comments suppressed due to low confidence (1)
app/dump/page.tsx:110
fetchGistDump()is also invoked from thisuseEffectand it updates state (setLoading,setDump,setError). With only the Bytebin call suppressed,react-hooks/set-state-in-effectis likely to keep failing lint for the gist path.
useEffect(() => {
if (bytebin) {
// eslint-disable-next-line react-hooks/set-state-in-effect
fetchBytebinDump();
} else if (gist) {
fetchGistDump();
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "lint" CI job was failing with 25 problems (22 errors, 3 warnings) across two categories.
Prettier formatting (
next.config.ts)18 redirect objects written on a single line exceeded the configured print width and needed to be expanded to multi-line format. Fixed via
eslint --fix.React Compiler
react-hooks/set-state-in-effecterrorsThe React Compiler ESLint plugin flagged
setStatecalls invoked—directly or inside async fetch functions—fromuseEffectbodies in 4 files. These are intentional patterns (readinglocalStorageon mount, initiating async data fetches) that don't have a simpler equivalent without broader refactoring. Added targetedeslint-disabledirectives:components/BetaBanner.tsx— synchronoussetIsVisibleafterlocalStoragecheckcomponents/footer.tsx— synchronoussetThemeModefrom persisted preferencecontexts/shared-data.tsx— block disable covering all async data-fetch calls in the bootstrap effectapp/dump/page.tsx—fetchBytebinDump()which internally callssetStatein async callbacks