ci(prettier): add prettier
check to Actions
#2758
Merged
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.
Background
Currently
prettier
runs as part ofESLint
on the codebase but that is kind of slow and definitely slows feedback in your editor while coding and running ESLint in your editor simultaneously. We should also encourage devs to useprettier
in their editor to auto-format and catch formatting issues before committing.One way we can still catch
prettier
errors without running it inESLint
is to have an action that runs against PRs and catches any newprettier
errors introduced in the new PR and report them via a comment. The comment will also mention how to fix it and even how to set up auto-formatting for newcomers or people who don't already haveprettier
setup in their editor.What this PR does
prettier-fmt
Github Action workflow and adapts it for Medplum's setupprettier
formatting issues throughout the codebase so that we can start from a clean slateNext Steps
This synergizes with the changes in #2748 to remove
prettier
from theeslint
config well and when that PR is merged we should see a slight decrease in time toESLint
feedback.There also may be some debugging required to make sure this action is working. GitHub Action workflows are notoriously hard to debug so
derrick/test-actions
has been indicated in the new workflow as a branch to trigger this workflow on PR. The workflow can then be ensured working before we add it to PRs onmain
if we choose to go this route.