Run prettier over the codebase to reduce CI problems. #10037
Closed
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.
Throughout my work on #10024, I found that I would get intermittent prettier errors from CI, and some of them seemed arbitrary. Changes that didn't fix any prettier issues would make CI prettier stop complaining, and changes that didn't add any bad formatting would make CI prettier get unhappy. Further,
npm run prettieroryarn prettier(the recommended fix) never fixed the CI problems I was having.I've since realized that the reason that
npm run prettierwasn't working was that that command attempts to run prettier over only the changed files, but CI checks all files to make sure they are correctly formatted. And, for whatever reason,masterhas a few dozen files that are incorrectly formatted right now. I suspect these files creeped in because of some problem in CI that was causing the arbitrariness I was seeing, but I'm not entirely sure.This PR is just a result of running
npm run prettier-allover the codebase and then fixing one tiny problem with linting (prettier eliminated threeeslint-disable-linecomments inReactDOMServerIntegration-test.jswhich I had to reinstate).This PR doesn't fix the core problem that CI seems to sometimes approve of builds that violate prettier's formatting and thereby lets incorrectly formatted files in, but I honestly can't really figure out why that happens. In the meantime, though, I'm hoping that this checkin will reduce the number of times CI complains about my other PRs.