Skip to content

chore(lint)!: adopt cloudflare oxlint preset - #154

Merged
cheetahbyte merged 2 commits into
mainfrom
chore/new-lint-rules
Nov 23, 2026
Merged

cheetahbyte merged 2 commits into
mainfrom
chore/new-lint-rules

Conversation

@cheetahbyte

Copy link
Copy Markdown
Contributor

Summary

Adopt @cloudflare/oxlint-config 0.1.0, upgrade Oxlint and its type-aware backend, and remove the custom rules, Effect plugin, and vendored anti-slop implementation. Fix the preset's findings across the server, web app, landing site, and development tools without adding rule overrides or suppressions; retain the existing file exclusions.

The migration also replaces unsafe boundary assertions with validation and narrower types. The web API client now takes runtime route names and validates JSON responses against the contract for their HTTP status; UI fixtures now supply contract-valid bodies and statuses.

Why

Use a maintained shared preset instead of maintaining project-specific lint plugins. Keep the preset enabled and resolve its findings rather than adopting it with disabled rules.

Evidence

  • Lint: 4,988 errors → 0 errors, 0 warnings under the new preset.
  • bun run check: passes, including formatting, server/web type checks, OpenAPI drift, and 1,272 passing tests; 118 environment-dependent tests skipped (16.73 seconds in the pre-push run).
  • API-validation regression: bypassing response parsing makes the new malformed-response test fail; restoring validation passes.
  • Pre-push checks: frozen-lockfile installs, docs validation/build, and site client/SSR build plus type check all pass. The site build emits a CSS sourcemap warning.
  • No manual browser verification performed.

Risk and rollback

Reversibility: Reversible by reverting this commit; no database migration.

Blast radius: Workspace-wide TypeScript/React lint migration (549 files), server runtime boundaries, browser API handling, landing-site animations, and development scripts.

  • Breaking tool-output change: event_payload text pages now report encoding: "utf8" rather than "utf-8", as explicitly selected for this migration. Binary pages remain "base64"; no HTTP endpoint or stored record carries this value.
  • Browser response validation now rejects malformed or undocumented-status JSON responses that the old type assertions accepted, and bundles the route schemas into the web app.
  • A package-specific release-age exception permits installing the newly published Cloudflare preset; the three-day safeguard remains enabled for other non-exempt packages.
  • Most changes are mechanical braces, array types, type-only imports, and related fixes, but boundary validation, React resource lifetimes, and error handling warrant review beyond the mechanical diff.

Replace custom rules and vendored plugins with the Cloudflare preset and fix its findings across the workspace. Validate web JSON responses against route schemas and strengthen runtime typing at server boundaries.

BREAKING CHANGE: event_payload text pages now report encoding "utf8" instead of "utf-8". Binary pages remain "base64".
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

React Doctor found 1 new issue in 1 file · 1 warning · score 90 / 100 (Great) · 0 fixed · vs main

1 warning

components/markdown.tsx

  • ⚠️ L17 Non-static dynamic import path no-dynamic-import-path

Reviewed by React Doctor for commit cde5fc0. See inline comments for fixes.

const loadPele = (): Promise<typeof Pele> => import(PELE);
type Pele = { mountAsync: typeof mountAsync };

const loadPele = (): Promise<Pele> => import(PELE);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React Doctor · react-doctor/no-dynamic-import-path (warning)

This can stay in the main bundle because the bundler cannot code-split a dynamic import path. Use a plain string path instead.

Fix → Use a plain string path: import('./feature/heavy.js') so the bundler can split this into its own chunk.

Docs

@cheetahbyte
cheetahbyte merged commit 125cefd into main Nov 23, 2026
9 checks passed
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