Fix all existing prettier issues #13643
Open
+510
−566
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.
What? Why?
While working on #13639, I realized that our prettier is action is broken in a few ways:
As manifested by Verify if latest reviewdog fixes issues with big diffs #13639, it does not work for big PRs because of an old bug, and we suffer from it because for prettier we're running a very old version. This is what Verify if latest reviewdog fixes issues with big diffs #13639 is fixing.
It does not post anything to the checks API due to permission issues, so it's essentially permanently silent and green. This should be easy to fix by tweaking linters workflow permissions. I will create a PR for this later if we decide to keep reviewdog.
Finally, reviewdog's default filter mode (name "added", which acts only on changed files) seems to have issues and filters out all files. But even if it worked, it may create unnecessary burden for contributors when they change lines with style issues, even if it was not them who introduced them. I think it'd be best if we use the
nofiltermode, and make sure the codebase have zero issues. That fixes both problems and it's the approach already used by rubocop since Test all files with Rubocop, not just added code in the diff #12393, because of the same reason.This PR is in preparation for changing reviewdog to run prettier in
nofiltermode and fix the remaining issues mentioned above.What should we test?
Prettier is just a formatter so should never break anything, but I did go through the diff just to make sure there are no "formatting bugs". Also a green CI would be reassuring.
Release notes