You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds explicit Prettier ignore patterns for files in test-project/ that are already ignored by the nested .gitignore file. This is a workaround for Prettier's limitation where it doesn't respect nested .gitignore files (GitHub issue #4081).
/test-project/api/types/graphql.d.ts - Auto-generated GraphQL type definitions
/test-project/web/types/graphql.d.ts - Auto-generated GraphQL type definitions
All three patterns correctly mirror the patterns in test-project/.gitignore, ensuring Prettier doesn't format auto-generated files that should be ignored. The PR description notes this workaround can be removed when switching to oxc-format, which natively supports nested gitignore files.
Confidence Score: 5/5
This PR is safe to merge with no risk
This is a simple configuration change that only adds ignore patterns to .prettierignore. The patterns correctly mirror the nested .gitignore file, preventing Prettier from formatting auto-generated files. No functional code changes or breaking changes are introduced.
No files require special attention
Important Files Changed
Filename
Overview
.prettierignore
Added explicit ignore patterns for test-project files already ignored by nested .gitignore as workaround for Prettier limitation
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant Prettier as Prettier CLI
participant RootIgnore as .prettierignore
participant NestedIgnore as test-project/.gitignore
participant Files as test-project files
Dev->>Prettier: Run prettier format
Prettier->>RootIgnore: Read root .prettierignore
Note over Prettier,NestedIgnore: Prettier doesn't respect<br/>nested .gitignore files<br/>(Issue #4081)
Prettier->>NestedIgnore: ❌ Cannot read nested .gitignore
Note over RootIgnore: Workaround: Explicitly list<br/>nested gitignore patterns<br/>in root .prettierignore
RootIgnore-->>Prettier: Skip /test-project/.redwood/<br/>Skip /test-project/api/types/graphql.d.ts<br/>Skip /test-project/web/types/graphql.d.ts
Prettier->>Files: Format only non-ignored files
Files-->>Dev: Correctly formatted files
Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci
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
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.
Workaround for prettier/prettier#4081
If/when we switch over to oxc-format we won't need this anymore oxc-project/oxc#17352