bug: Prisma generated files under generated/prisma are reformatted by Prettier, causing persistent git diff churn in fresh T3 scaffold

Author: brucexu-ethCreated Mar 6, 2026Updated Jul 14, 2026
Labels🐞❔ unconfirmed bug

Provide environment information

  • System:
    • OS: macOS 26.3
    • CPU: (20) arm64 Apple M1 Ultra
    • Memory: 777.50 MB / 64.00 GB
    • Shell: 5.9 - /bin/zsh
  • Binaries:
    • Node: 22.22.0
    • npm: 10.9.4
    • bun: 1.3.5
  • Packages:
    • Prettier: 3.8.1
    • Prisma CLI: 6.19.2
    • @prisma/client: 6.19.2
    • create-t3-app initVersion: 7.40.0
    • Database: SQLite (default scaffold)
    • Component:
      • package.json formatting scripts (format:check, format:write)
      • prisma/schema.prisma (generator client output = "../generated/prisma")

Describe the bug

Description

In a fresh T3 scaffold with Prisma output directed to generated/prisma, generated Prisma client files are included in broad Prettier globs. This causes repeated churn:

  • prettier --write reformats generated files
  • prisma generate rewrites them back
  • git shows noisy diffs in generated/prisma/**

Current Behavior

  • generated/prisma/** files are tracked and repeatedly modified by formatting/generation commands.
  • prettier --check reports generated files as style violations.
  • Running install/postinstall (which runs prisma generate) re-changes those files again.

Expected Behavior

Generated Prisma artifacts should not create formatting/diff churn in normal developer workflows.

Impact

  • Large noisy diffs in PRs
  • Confusing local state (AM / repeated modified generated files)
  • Reduced signal-to-noise for code review

Proposed Solution

  1. Add generated/prisma to .prettierignore (required to stop format churn).
  2. Add generated/prisma to .gitignore (if the template intends not to track generated artifacts).
  3. Optionally narrow formatting scripts to app/source files only (instead of **/*.{ts,tsx,js,jsx,mdx}).
  4. If files were already tracked, untrack once:
    • git rm -r --cached generated/prisma

Reproduction repo

https://github.com/brucexu-eth/t3-prisma-issue

To reproduce

bun create t3-app@latest and select the following options

Image

you will see a lot of changes in generated/ folder, which should be ignored.

Additional information

No response