Configure prettier to run on the whole repo #1341
Open
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.
This PR configures prettier so it runs on all js/ts/json files, not just the ones in
src/locales
, to make the code more uniformly formatted.To do that we move the prettier config to
.prettierrc.js
so that the prettier CLI, vscode and other editors can access it for things like formatOnSave. Previously runningprettier --write .
orprettier --check .
from the command line would use the default prettier config, ignoring what was in.eslintrc.js
.It also adds a workspace vscode config that contains a launch script to debug the app, and, notably, a settings config that turns on formatOnSave by default. I submit that this is a preferable way to code, since it doesn't require the engineer to fix things manually or run a fix script to handle simple formatting.
If we're a thumbs up on this change I'll add a commit that runs prettier on the whole repo before merging to handle any existing formatting issues.