fix(prettier): add .prettierignore to exclude generated Prisma client - #2240
Open
gonzoblasco wants to merge 1 commit into
Open
fix(prettier): add .prettierignore to exclude generated Prisma client#2240gonzoblasco wants to merge 1 commit into
gonzoblasco wants to merge 1 commit into
Conversation
When scaffolding with Prisma + ESLint/Prettier, the format scripts use a
broad **/*.{ts,tsx,js,jsx,mdx} glob that sweeps generated/prisma/**.
Prettier does not read .gitignore by default, so the /generated/ entry
there offered no protection. This caused persistent git diff churn:
prettier --write reformats generated files, prisma generate rewrites
them back, repeat on every install.
Add a .prettierignore template (config/_prettierignore) that excludes
generated/ and copy it to the project root from the ESLint installer.
Fixes t3-oss#2217
gonzoblasco
requested review from
c-ehrlich,
juliusmarminge,
nexxeln and
t3dotgg
as code owners
July 15, 2026 16:32
🦋 Changeset detectedLatest commit: 3b1dc5e 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
vichudo
approved these changes
Jul 30, 2026
vichudo
left a comment
There was a problem hiding this comment.
supporting this, Highly necessary 🙌🏻
4 tasks
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 + ESLint/Prettier, the format scripts (
format:write,format:check) use a broad**/*.{ts,tsx,js,jsx,mdx}glob that sweeps throughgenerated/prisma/**. Prettier does not read.gitignoreby default, so the existing/generated/entry in.gitignoreoffers no protection.This causes a persistent churn cycle:
prettier --writereformats generated Prisma client filesprisma generate(runs onpostinstall) rewrites them back to original formatgenerated/prisma/**on every install/formatRoot Cause
The template has no
.prettierignore. The.gitignoreentry for/generated/is irrelevant to Prettier — it only reads.prettierignoreor the file specified by--ignore-path(neither exists in the scaffold).This is the Prettier counterpart to #2226 (Biome linting generated files), with the same underlying cause: generated artifacts are not excluded from the formatter/linter.
Fix
1. Add
.prettierignoretemplate (cli/template/extras/config/_prettierignore)The
_prefix follows the existing convention for dotfiles in the template (e.g._gitignore,_npmrc) to ensure npm includes them in the package.2. Copy
.prettierignoreto the project from the ESLint installerThe file is only relevant when ESLint/Prettier is selected (Biome users are unaffected — Biome has its own
files.includesignore mechanism, fixed in #2239). The copy is added todynamicEslintInstalleralongside the existing Prettier config copy.Fixes #2217
Testing
pnpm --filter create-t3-app typecheckpassespnpm --filter create-t3-app buildpassespatch)pnpm create t3-app, select Prisma + ESLint/Prettier, runpnpm format:write, verifygenerated/is not touched