Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure prettier to run on the whole repo #1341

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

justinhaaheim
Copy link
Contributor

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 running prettier --write . or prettier --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.

Copy link
Contributor

@jaraco jaraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue has affected me too when I was getting failing checks locally but not in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants