Skip to content

fix(biome): ignore generated/ and bump minimum version to ^2.5.3 - #2239

Open
gonzoblasco wants to merge 2 commits into
t3-oss:mainfrom
gonzoblasco:fix/2226-biome-ignore-generated
Open

fix(biome): ignore generated/ and bump minimum version to ^2.5.3#2239
gonzoblasco wants to merge 2 commits into
t3-oss:mainfrom
gonzoblasco:fix/2226-biome-ignore-generated

Conversation

@gonzoblasco

@gonzoblasco gonzoblasco commented Jul 15, 2026

Copy link
Copy Markdown

Description

When scaffolding a T3 app with Prisma + Biome, the post-install biome check --write --unsafe . command fails because it lints Prisma's generated files under generated/ (e.g. generated/prisma/query_engine_bg.js, generated/prisma/runtime/index-browser.d.ts). These files contain patterns that Biome flags as errors (noCommaOperator, noExplicitAny, noAssignInExpressions), but they are machine-generated and should not be linted.

Root Cause

Two separate issues cause the scaffolding failure:

  1. Missing explicit ignore for generated/ — The template's .gitignore includes /generated/, and biome.jsonc has "useIgnoreFile": true. However, when users opt out of git initialization during scaffolding, Biome's VCS integration cannot resolve the ignore file. Without a .git directory, Biome falls back to linting all files, including Prisma's generated client code.

  2. Stale minimum Biome version — The pinned minimum ^2.2.5 cannot parse the template's biome.jsonc at all. The config uses CSS parser options (cssModules, tailwindDirectives) and assist actions (useSortedAttributes) that were introduced in Biome 2.3.0. If a user's lockfile or offline cache resolves to exactly 2.2.5, Biome aborts with a configuration parse error before it even gets to linting.

Fix

1. Bump @biomejs/biome from ^2.2.5 to ^2.5.3

Ensures the installed Biome version can parse all options in the template's config. The ^ range still allows newer 2.x patches.

2. Add explicit files.includes to biome.jsonc

"files": {
  "includes": ["**", "!**/generated"]
}

This uses Biome's recommended include/exclude syntax (introduced in 2.3.0) to deterministically exclude the generated/ directory regardless of VCS state, git initialization, or ignore-file resolution. This is the same pattern Biome's own init command uses for generated folders.

Fixes #2226

Testing

  • Change is a 3-file fix: version map, biome config, changeset
  • pnpm --filter create-t3-app typecheck passes
  • pnpm --filter create-t3-app build passes
  • Manual: scaffold with bun create t3-app, select Prisma + Biome, verify bun run check:unsafe succeeds without linting generated files

Prisma generates files under generated/ (e.g. query_engine_bg.js,
runtime/index-browser.d.ts) that contain patterns biome flags as errors
(noCommaOperator, noExplicitAny, noAssignInExpressions). These are
machine-generated files that should not be linted.

While the .gitignore already has /generated/ and biome.jsonc has
useIgnoreFile: true, the ignore-file behavior can be unreliable on some
platforms (notably Windows). Adding an explicit files.ignore entry makes
the exclusion deterministic regardless of platform or ignore-file
resolution behavior.

Fixes t3-oss#2226
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
create-t3-app Ready Ready Preview, Comment Jul 15, 2026 2:14pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a7d43cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-t3-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Two related fixes for Biome + Prisma scaffolding failures (t3-oss#2226):

1. Bump @biomejs/biome minimum from ^2.2.5 to ^2.5.3
   The template's biome.jsonc uses CSS parser options (cssModules,
   tailwindDirectives) and assist actions (useSortedAttributes) that
   were introduced in Biome 2.3+. Resolving to 2.2.5 (offline caches,
   locked registries) caused a config parse error that aborted scaffolding.

2. Add explicit files.includes with !**/generated to biome.jsonc
   Previously, excluding generated/ relied solely on .gitignore via VCS
   integration. When users opted out of git init, Biome could not resolve
   the ignore file and linted Prisma's generated client, causing
   check:unsafe to fail with 290+ diagnostics on machine-generated code.

Fixes t3-oss#2226
@gonzoblasco gonzoblasco changed the title fix(biome): explicitly ignore generated/ directory in biome config fix(biome): ignore generated/ and bump minimum version to ^2.5.3 Jul 15, 2026
@gonzoblasco

Copy link
Copy Markdown
Author

Gentle bump on this one - it's been approved on the related prettier PR (#2240) and this is the Biome counterpart. Anything else needed?

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.

bug: installing with bun fails "check:unsafe"

1 participant