Skip to content

chore: prettier-ignore tsconfig.json so next build reformatting doesn't fail check-format (#4885)#4886

Merged
NoopDog merged 1 commit into
mainfrom
fran/4885-tsconfig-prettier
Jul 1, 2026
Merged

chore: prettier-ignore tsconfig.json so next build reformatting doesn't fail check-format (#4885)#4886
NoopDog merged 1 commit into
mainfrom
fran/4885-tsconfig-prettier

Conversation

@frano-m

@frano-m frano-m commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #4885.

next build / next dev rewrites tsconfig.json into a multiline shape (expanded arrays + a .next/dev/types/**/*.ts include entry) that fails prettier --check. Because the pre-commit hook runs check-format (prettier --check .) across the whole repo, committing after a build fails the hook on tsconfig.json — forcing a --no-verify bypass — and the file shows as perpetually "modified" in git status.

tsconfig.json is a Next-managed file, so this adds it to .prettierignore, letting Next own its format without prettier fighting it. The committed tsconfig.json itself is already prettier-clean and is left unchanged.

Change

  • .prettierignore: add tsconfig.json under the existing # next.js section.

Verification

  • With tsconfig.json in its build-modified (multiline) state, npm run check-format now exits 0 (previously failed)
  • Committed tsconfig.json unchanged and still prettier-clean
  • Pre-commit hook (check-format + lint + tsc) passes without --no-verify

🤖 Generated with Claude Code

…'t fail check-format (#4885)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents next build / next dev from causing Prettier format-check failures by excluding the Next-managed tsconfig.json from repository-wide prettier --check runs, aligning with the workflow where Next may rewrite that file into a shape Prettier rejects.

Changes:

  • Add tsconfig.json to .prettierignore under the existing Next.js ignore section.
  • Document why it’s ignored (Next rewrites it during build; reference #4885).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NoopDog NoopDog merged commit afa4f46 into main Jul 1, 2026
4 checks passed
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.

chore: next build reformats tsconfig.json into a shape prettier rejects, failing the pre-commit check-format hook

3 participants