Skip to content

chore(lint): add ESLint flat config + CI lint/build gate#6

Open
Builder106 wants to merge 1 commit into
ArunNGun:mainfrom
SankofaForge-Hacks:chore/eslint-setup
Open

chore(lint): add ESLint flat config + CI lint/build gate#6
Builder106 wants to merge 1 commit into
ArunNGun:mainfrom
SankofaForge-Hacks:chore/eslint-setup

Conversation

@Builder106

Copy link
Copy Markdown
Contributor

Summary

The repo has no linter today. This adds one to the v3.0.0 React codebase with a green baseline, plus a CI gate so future PRs get checked automatically.

Changes

  • eslint.config.mjs — ESLint 9 flat config: @eslint/js recommended + eslint-plugin-react (jsx-runtime) + eslint-plugin-react-hooks. Scoped to src/ (the live app) and the Node build scripts; legacy dirs (frontend/, electron/) and static sites (docs/, landing/) are ignored.
  • npm run lint script + dev dependencies (eslint@^9, pinned below 10 for eslint-plugin-react peer compatibility).
  • .github/workflows/ci.yml — runs npm run lint + npm run build:frontend on PRs and pushes to main. Full Tauri builds stay in the existing tag-triggered release.yml.

Baseline

Green — 0 errors, 19 warnings (pre-existing exhaustive-deps / unused-var advisories, left as non-blocking signal). Two rules tuned to the codebase's intent rather than rewriting working code:

  • no-empty: { allowEmptyCatch: true } — the deliberate catch {} blocks are fine.
  • react-hooks/set-state-in-effect: 'warn' — the app intentionally syncs external config into state inside effects; surfaced, not blocked.

Bug caught on first run

ESLint immediately flagged a real one: API.elevateNotchWindow in src/lib/api.js called a bare invoke that isn't defined in the module (every other method uses tauriInvoke), so calling it would throw ReferenceError at runtime. Fixed in this PR (one line).

Testing

  • npm run lint → passes (exit 0)
  • npm ci → lockfile in sync
  • npm run build:frontend → clean

Introduce a linter to the v3.0.0 React codebase. The setup is scoped to
src/ (the live app) and the Node build scripts; legacy dirs (frontend/,
electron/) and static sites (docs/, landing/) are ignored.

- eslint 9 flat config (eslint.config.mjs) with @eslint/js recommended +
  eslint-plugin-react (jsx-runtime) + eslint-plugin-react-hooks
- `npm run lint` script
- .github/workflows/ci.yml — runs lint + frontend build on PRs and pushes
  to main (full Tauri builds stay in the tag-triggered release.yml)

Baseline is green (0 errors). Two rules tuned to the codebase's intent:
allowEmptyCatch for deliberate `catch {}`, and react-hooks/set-state-in-effect
downgraded to a warning (intentional config→state sync in effects).

Also fixes one genuine bug the linter caught on first run: API.elevateNotchWindow
called a bare `invoke` that doesn't exist in api.js (every other method uses
tauriInvoke), which would throw ReferenceError at runtime.
@Builder106 Builder106 requested a review from ArunNGun as a code owner June 10, 2026 22:37
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