Skip to content

Prettier workflow adds unrelated formatting churn to feature PRs #417

Description

@anirudh5harma

Bug

Feature PRs can get unrelated formatting commits from the Prettier workflow even when the feature change itself is small.

Reproduction

  1. Open a feature branch from the current main.
  2. Push a small change that does not touch docs, generated route output, or lockfiles.
  3. Let the Prettier GitHub Actions workflow run on the branch.
  4. Observe a bot commit that formats files unrelated to the feature branch, such as existing docs drift, generated router output, or lockfiles.

Root Cause

main has files that do not currently match the repository Prettier configuration. The workflow runs npx --yes prettier@3 --write . on every non-main branch push, so it formats all existing drift on the feature branch and pushes that as a follow-up commit.

Some files that should not be formatter-owned are also not ignored, including the generated TanStack route tree and the pnpm lockfile.

Fix

Establish a Prettier-clean baseline on main and update .prettierignore so generated route output and pnpm lockfiles are not rewritten by the formatter.

Impact

Future feature PRs should stay focused on their actual changes instead of inheriting broad docs/generated/lockfile formatting churn from main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions