Skip to content

Fix npm run lint and run it in CI - #41

Merged
bassam merged 1 commit into
modelplaneai:mainfrom
bassam:fix-lint
Oct 20, 2026
Merged

bassam merged 1 commit into
modelplaneai:mainfrom
bassam:fix-lint

Conversation

@bassam

@bassam bassam commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What and why

npm run lint fails on every checkout. It calls next lint, which Next 16 removed (Invalid project directory provided, no such directory: .../lint), and the repo has no ESLint flat config, so running eslint directly fails too. Lint has silently not run, and 11 errors built up. #40 had to skip this checklist item because of it.

This PR:

  • Fixes the script: "lint": "eslint .", plus an eslint.config.mjs using eslint-config-next's core-web-vitals and TypeScript presets (the packages were already in devDependencies).
  • Fixes the 11 errors:
    • no-html-link-for-pages (9): internal links in Nav and Footer now use next/link. The RSS link in BlogSidebar stays a plain <a> with a scoped disable, because /feed.xml is XML, not a page Link can navigate to.
    • set-state-in-effect in Nav: the homepage now passes <Nav hero /> instead of Nav finding the hero and setting state synchronously in an effect. Behavior is the same on the homepage; other pages now render the logo from the first paint instead of flashing the hidden state before hydration (checked in the server-rendered HTML: / gets nav--top, /blog and /manifesto don't).
    • set-state-in-effect in PostList: the visible count resets during render when the posts prop changes (React's "adjusting state when a prop changes" pattern), instead of in an effect.
  • Keeps it fixed: adds a Lint step to the CI workflow (and eslint.config.mjs to its path filter), and updates CONTRIBUTING.md to say CI runs all three checks.

The 18 remaining warnings are mostly @next/next/no-img-element. Using plain <img> matches how the rest of the site is built, so they're left as is. Warnings don't fail lint.

Checklist

  • Ran npm run lint and npm run build locally. Lint: 0 errors, 18 warnings; build passes; tsc --noEmit is clean too.
  • Ran npm run validate-posts if I changed blog content. No blog content changed (ran it anyway; all 8 posts validate).
  • Signed off my commits with git commit -s.

`npm run lint` fails on every checkout: it calls `next lint`, which Next 16
removed, and the repo has no ESLint flat config, so running `eslint`
directly fails too. Lint has silently not run, and 11 errors built up.

Replace the script with `eslint .` and add an `eslint.config.mjs` using
eslint-config-next's core-web-vitals and TypeScript presets, then fix the
errors:

- Use next/link for internal links in Nav and Footer. The RSS link stays
  a plain anchor because /feed.xml is XML, not a page.
- Nav: the homepage now passes a `hero` prop instead of Nav discovering
  the hero and setting state synchronously in an effect. Pages without a
  hero render the logo from the first paint instead of after hydration.
- PostList: reset the visible count during render when the posts prop
  changes, rather than in an effect.

Add a lint step to the CI workflow so this does not regress, and update
CONTRIBUTING.md to say CI runs all three checks. The 18 remaining
warnings, mostly <img> over next/image, match how the site is built and
are left as is.

Signed-off-by: Bassam Tabbara <bassam@upbound.io>
@bassam
bassam merged commit 9957571 into modelplaneai:main Oct 20, 2026
2 checks passed
charliehinojosa added a commit to charliehinojosa/website that referenced this pull request Oct 20, 2026
Follow-up to the merged Inference Day page (modelplaneai#40), rebased onto the lint fix (modelplaneai#41):

- Make the hero and closing-CTA contrail full-bleed, sized in vw so the wave
  spans the section at every width (the fan reaches the lower-left, the lines run
  off the top-right) instead of being cut off; soften it on phones for legibility.
- Add a dismissible homepage announcement bar linking to /inference-day. It is
  rendered client-only (its visibility depends on localStorage and the date), so
  there is no effect-driven state and no hydration mismatch; it hides itself once
  the event has passed.
- Add an Inference Day link to the main nav (next to Slack, cyan accent) using
  next/link, and give the landing page a two-tier header: the main site Nav plus
  a slim event sub-nav for the on-page jump links. This replaces the standalone
  EventNav.

npm run lint, build and validate-posts all pass.

Signed-off-by: Charlie Hinojosa <charlie@sightbox.me>

This branch was successfully deployed

1 active deployment
Preview — 9da14d52 Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant