Skip to content

Replace Prettier and ESLint with Biome as formatter and linter - #595

Open
jamesrweb wants to merge 4 commits into
mainfrom
chore/biome-formatter-migration
Open

jamesrweb wants to merge 4 commits into
mainfrom
chore/biome-formatter-migration

Conversation

@jamesrweb

Copy link
Copy Markdown
Member

Related Issue

Fixes N / A

PR Type

  • 🐛 Bug Fix
  • ✨ New Feature
  • 🔨 Code Refactor
  • 📝 Documentation Update
  • 🧪 Test Update
  • 🔧 Build/CI Update
  • 🧹 Chore
  • ⏪ Revert

Description

Replaces Prettier and ESLint with Biome as the sole formatter and linter, aligning
this repository with the organisation-wide standard. A root biome.json now
carries the shared rules (2-space indent, double quotes, semicolons,
proseWrap: "always", organizeImports on, linter recommended preset plus
useBlockStatements: "error"), with "$schema" pointing at
./node_modules/@biomejs/biome/configuration_schema.json so it always tracks
the installed Biome version. Biome's linter also surfaced real issues in the demo
app and tests that ESLint never covered, fixed in the same change. A follow-up
commit refreshes dev dependencies via npm-check-updates and regenerates the
lock file, keeping typescript on the latest 6.x.x exact pin.

Proposed Changes

  • Add root biome.json (org base rules, version-tracking $schema)
  • package.json: format is now biome check --write ., lint is
    biome check .; removed format:check, lint:fix, and the prettier
    helper script; integrate is now pnpm lint && pnpm test && pnpm build
  • Remove prettier, @trivago/prettier-plugin-sort-imports, the React ESLint
    plugins, and the rest of the ESLint toolchain from devDependencies; add
    @biomejs/biome@2.6.4
  • Delete config/prettier/ and config/eslint/
  • Remove the now-orphaned eslint-plugin-react>eslint peer allowedVersions
    rule from pnpm-workspace.yaml
  • CI: the format job now runs pnpm lint
  • Update AGENTS.md and README.md (commands tables, formatting/linting
    sections, file tree, typescript pin note)
  • Fix Biome lint findings:
    • demo/app.jsx: removed unused React/useMemo imports (sketch list
      hoisted to module scope), removed spurious useCallback dependencies,
      added type="button" to all buttons
    • src/components/P5CanvasWithSketch.tsx: dropped refs from the
      useEffect dependency array (useExhaustiveDependencies)
    • tests/components/P5Canvas.test.tsx: hoisted ErrorChild to module level
      (noComponentHookFactories)
  • Follow-up commit: ncu -u plus lock file regeneration — vitest and
    @vitest/coverage-v8 moved to ^5.0.5 (vitest-canvas-mock@1.2.0 supports
    vitest 5 and the suite passes); typescript held at 6.0.3; packageManager
    bumped to pnpm@12.16.1

How Has This Been Tested?

  • Unit Tests
  • Integration Tests
  • Manual Testing (please describe)

Ran the full local pipeline: pnpm format, pnpm lint (exit 0, no warnings),
pnpm test (22 passed, 2 pre-existing skips), pnpm build (exit 0, component
and demo builds).

Screenshots/Recordings

Breaking Changes

  • Yes (please describe)
  • No

Checklist

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • My changes generate no new warnings

Additional Notes

No public API changes — everything exported from src/main.tsx is untouched.
Biome's reformatting of source files is the expected formatting migration, not
a behavioural change. The two it.skip-ped suspense tests remain skipped as
before.

Signed-off-by: James Robb <47126579+jamesrweb@users.noreply.github.com>
Signed-off-by: James Robb <47126579+jamesrweb@users.noreply.github.com>
@jamesrweb
jamesrweb requested a review from yevdyko as a code owner November 2, 2026 00:58
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Coverage report for commit: 7c8c964
File: ./coverage/clover.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  80% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  90% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
 100% │ ███████████████████████ │ 100.0%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution / ▒ = Previous Distribution
Summary - Lines: 100.00% ⏹️ | Methods: 100.00% ⏹️ | Branches: 100.00% ⏹️
FilesLinesMethodsBranches
src/components
   P5Canvas.tsx100.00%100.00%100.00%
   P5CanvasGuard.tsx100.00%100.00%100.00%
   P5CanvasWithSketch.tsx100.00%100.00%100.00%
src/contracts
   P5CanvasProps.ts100.00%100.00%100.00%
src
   main.tsx100.00%100.00%100.00%

🤖 comment via lucassabreu/comment-coverage-clover

Signed-off-by: James Robb <47126579+jamesrweb@users.noreply.github.com>
@jamesrweb jamesrweb self-assigned this Nov 2, 2026
@jamesrweb jamesrweb added enhancement dependencies Pull requests that update a dependency file documentation Pull requests that update project documentation labels Nov 2, 2026
Signed-off-by: James Robb <47126579+jamesrweb@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Pull requests that update project documentation enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant