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
When running nx repair on a repo, the nx.json file is updated in a way that is different from the format specified by .prettierrc. When running nx format:write after, the generated diff is gone.
This means that nx repair generates nx.json that is unstable.
Expected Behavior
The updated nx.json created by running nx repair should be properly formatted by prettier.
Notice that nx.json is updated: the diff is coming solely from formatting
Run nx format:write: notice that diff disappears
This suggests that the output of nx repair is not property formatted. I would expect the files generated by nx repair is already properly formatted, because we run nx format:check in our CI pipeline to ensure that PRs are properly formatted. A team member who just ran nx repair may commit the changes without knowing it is not correctly violated. Of course this can be fixed with a pre-push hook, but I would expect formatting to be part of the job done by nx repair.
…27082)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
## Current Behavior
<!-- This is the behavior we have today -->
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes#25122
(cherry picked from commit 8afd3ea)
Current Behavior
When running
nx repair
on a repo, thenx.json
file is updated in a way that is different from the format specified by.prettierrc
. When runningnx format:write
after, the generated diff is gone.This means that
nx repair
generatesnx.json
that is unstable.Expected Behavior
The updated
nx.json
created by runningnx repair
should be properly formatted by prettier.GitHub Repo
https://github.com/terrymun/nx-repair-prettier
Steps to Reproduce
nx repair
nx.json
is updated: the diff is coming solely from formattingnx format:write
: notice that diff disappearsThis suggests that the output of
nx repair
is not property formatted. I would expect the files generated bynx repair
is already properly formatted, because we runnx format:check
in our CI pipeline to ensure that PRs are properly formatted. A team member who just rannx repair
may commit the changes without knowing it is not correctly violated. Of course this can be fixed with a pre-push hook, but I would expect formatting to be part of the job done bynx repair
.Nx Report
Failure Logs
No response
Package Manager Version
4.1.0
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: