chore: make npm run lint runnable - #6
Open
tylerkstevens wants to merge 1 commit into
Open
Conversation
The repo had no ESLint config, so `next lint` dropped into its interactive "How would you like to configure ESLint?" setup prompt and never completed. Lint has therefore never run in CI or locally, and the pre-PR check of lint + build + test could not pass. - add eslint.config.mjs — flat config (ESLint 9) spreading the array eslint-config-next already exports. It ships ignores for .next/, out/, build/ and next-env.d.ts, so they are not repeated - switch the lint script from `next lint` to `eslint .`. `next lint` is deprecated and is removed entirely in Next 16 Lint then reported 4 errors from 3 root causes, all pre-existing: - AnnouncementBanner declared its LinkOrA wrapper inside the render, giving the component a new identity every render and remounting the banner contents. Hoisted to module scope as BannerLink - AnnouncementBanner and CountdownTimer both call setState in a mount effect. Both are deliberate hydration guards — localStorage and the client clock are unavailable during SSR — so each gets a targeted eslint-disable-next-line with the reason. The rule stays at error strength for new code - Logo.tsx carried an eslint-disable for a rule that no longer fires on <img> inside <picture>. Removed 7 @next/next/no-img-element warnings remain and do not fail the run. Several are intentional (remote avatars, supporter logos); converting them to next/image is a separate call. Verified: lint, build and test all exit 0. AnnouncementBanner and CountdownTimer both render from null data, so both were temporarily activated to exercise them — internal and external banner branches (target/rel correct on external), dismiss writes localStorage and hides the banner, and the countdown ticks after hydration. The temporary data edits were reverted; data/ is untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
npm run linthas never been able to complete in this repo. There is no ESLint config file, sonext lintdrops into its interactive "How would you like to configure ESLint?" setup prompt and hangs. Reproduced on a clean tree, so this is pre-existing — not a regression from any branch.Consequence: the pre-PR check of lint + build + test could not pass, and lint has effectively never run locally or in CI.
The fix
eslint.config.mjs— flat config (ESLint 9), spreading the arrayeslint-config-nextalready exports. It ships its own ignores for.next/,out/,build/andnext-env.d.ts, so those aren't repeated.lintscript fromnext linttoeslint ..next lintis deprecated and is removed entirely in Next 16, so this is needed regardless.No new dependencies —
eslintandeslint-config-nextwere already indevDependencies.What lint then found
4 errors from 3 root causes, all pre-existing:
AnnouncementBanner.tsxdeclared itsLinkOrAwrapper inside the renderBannerLink.AnnouncementBannerandCountdownTimer.tsxcallsetStatein a mount effectlocalStorageand the client clock don't exist during SSR. Each gets a targetedeslint-disable-next-linewith the reason inline. The rule stays at error strength for new code.Logo.tsxcarried a disable for a rule that no longer fires<img>inside<picture>isn't flagged. Removed.7
@next/next/no-img-elementwarnings remain and do not fail the run. Several are intentional (remote Nostr avatars, supporter logos); converting them tonext/imageis a separate decision.Verification
npm run lint && npm run build && npm testnow passes end to end — first time that's true in this repo.tsccaught a mistake lint missed: the first pass replaced theLinkOrAusages but left the dead definition behind. Lint stayed green, the build failed. Fixed and re-verified.nulldata (activeAnnouncementandnextEventDateare bothnull), so neither is reachable as shipped. I temporarily activated each rather than assume they were fine: internal and external banner branches (external correctly getstarget="_blank"+rel="noopener noreferrer"), dismiss writeslocalStorageand hides the banner, and the countdown ticks after hydration. Both temp edits reverted —data/is untouched.Recommend merging this before the other open branches so they inherit a working lint.
🤖 Generated with Claude Code