fix(biome): ignore generated/ and bump minimum version to ^2.5.3 - #2239
Open
gonzoblasco wants to merge 2 commits into
Open
fix(biome): ignore generated/ and bump minimum version to ^2.5.3#2239gonzoblasco wants to merge 2 commits into
gonzoblasco wants to merge 2 commits into
Conversation
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
gonzoblasco
requested review from
c-ehrlich,
juliusmarminge,
nexxeln and
t3dotgg
as code owners
July 15, 2026 04:07
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: a7d43cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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
4 tasks
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 undergenerated/(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:
Missing explicit ignore for
generated/— The template's.gitignoreincludes/generated/, andbiome.jsonchas"useIgnoreFile": true. However, when users opt out of git initialization during scaffolding, Biome's VCS integration cannot resolve the ignore file. Without a.gitdirectory, Biome falls back to linting all files, including Prisma's generated client code.Stale minimum Biome version — The pinned minimum
^2.2.5cannot parse the template'sbiome.jsoncat 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/biomefrom^2.2.5to^2.5.3Ensures 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.includestobiome.jsoncThis 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 owninitcommand uses for generated folders.Fixes #2226
Testing
pnpm --filter create-t3-app typecheckpassespnpm --filter create-t3-app buildpassesbun create t3-app, select Prisma + Biome, verifybun run check:unsafesucceeds without linting generated files