Skip to content

chore(lint): enable Oxlint suspicious and perf rules - #1132

Closed
tembo[bot] wants to merge 2 commits into
tembo/vite-plus-maintenancefrom
tembo/lint-rules
Closed

tembo[bot] wants to merge 2 commits into
tembo/vite-plus-maintenancefrom
tembo/lint-rules

Conversation

@tembo

@tembo tembo Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Turns on more of Oxlint for the site, so vp check catches more bugs and accessibility problems. Stacked on #1131. GitHub retargets this PR when #1131 merges.

Changes

  • vite.config.ts lint config:
    • The correctness, suspicious and perf categories are errors. Enabling whole categories means rules that future Vite+/Oxlint releases add to them apply automatically.
    • New plugins: import, promise, react (including the hooks rules) and jsx-a11y, plus the defaults, which have to be listed again once plugins is set.
    • Explicit errors: typescript/switch-exhaustiveness-check, react/rules-of-hooks and react/exhaustive-deps.
    • react/react-in-jsx-scope is off, because the automatic JSX runtime (jsx: react-jsx) doesn't need React in scope.
    • import/no-unassigned-import allows *.css, so stylesheet imports for their side effects are fine.
    • I left the React-performance plugin out: it flags inline event handlers, and wrapping every handler on a docs page in useCallback isn't worth it.
  • Fixes (behavior-preserving):
    • Replaced unsafe as casts with real types. Ref callbacks now store HTMLElement | null (React passes null on unmount, so the cast was never true). The Boundary example narrows the <select> value against its option list instead of casting. The behavior state in ExampleIfNeeded gets a union type in place of as any.
    • Removed an unneeded as HTMLElement before Styler().
    • Renamed a left parameter that shadowed an outer variable.
    • The Bulma purge plugin in astro.config.mjs now has a single return path.

Validation

  • vp check passes with no warnings or errors, vp run typecheck (astro check) reports 0 errors and 0 warnings, and vp exec knip passes.
  • I planted a violation for each enabled group in a scratch file: no-shadow (suspicious), no-accumulating-spread (perf), import, promise, jsx-a11y/alt-text, both React hooks rules, and switch-exhaustiveness-check. Each one failed as an error.
  • vp run build matches the base branch except the ExampleBoundary chunk (the <select> narrowing and instanceof Element ref) and that chunk's hash in index.html.

Want tembo to make any changes? Add a comment with @tembo and i'll get back to work!

View on Tembo  Review in Tembo  View Agent Settings

Co-authored-by: tembo[bot] <208362400+tembo-io[bot]@users.noreply.github.com>
@tembo tembo Bot added the tembo Pull request created by Tembo label Nov 11, 2026
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scroll-into-view-dev Ready Ready Preview Nov 15, 2026 8:11pm UTC

Request Review

@stipsan
stipsan added this pull request to stack #1133 November 11, 2026 17:49
…o tembo/lint-rules

Co-authored-by: Cody <81981+stipsan@users.noreply.github.com>
@cursor

cursor Bot commented Nov 15, 2026

Copy link
Copy Markdown

Superseded by #1136, which landed the same Oxlint rules on current main (ca2e4dd), including the instanceof guard for ExampleElAnimate.

@tembo

tembo Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@cursor[bot] Your organization has no available credits to process this request. Please purchase additional credits at app.tembo.io/settings/billing to continue.

@stipsan stipsan closed this Nov 15, 2026

This branch was successfully deployed

1 active deployment
Preview — 0e3df2bc Deployed Nov 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tembo Pull request created by Tembo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant