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

[Feature] enable Prettier to run automatically #520

Open
1 task done
dijitali opened this issue Apr 5, 2024 · 0 comments · May be fixed by #530
Open
1 task done

[Feature] enable Prettier to run automatically #520

dijitali opened this issue Apr 5, 2024 · 0 comments · May be fixed by #530
Labels
💻 aspect: code Concerns the software code in the repository 🤖 aspect: dx Concerns developers' experience with the codebase ✨ goal: improvement Improvement to an existing feature help wanted Open to participation from the community 🟩 priority: low Low priority and doesn't need to be rushed 🏁 status: ready for work Ready for work

Comments

@dijitali
Copy link
Contributor

dijitali commented Apr 5, 2024

Problem

I noticed when working on #507 that although this repository has the Prettier formatter enabled (since #351), it doesn't appear to be run automatically and so creates confusion when a contributor uses an IDE that does automatically apply the existing Prettier config (I believe I ran into it because of using VSCode with the official Prettier extension installed).

Description

My suggestion would be to enable Prettier via a pre-commit hook using Husky as recommended here.

If desired, prettier . --check could also be run in GitHub Actions, as suggested in Prettier docs.

I would also suggest re-adding the eslint-config-prettier package to ensure ESLint and Prettier play nicely. It appears to have been removed to reduce the build size in #468 but, since it's a devDependency, it won't affect the production build size.

Alternatives

Leave it as is and remove Prettier config, however it seems like the use of Prettier is one of the CC javascript guidelines.

Additional context

There is already something here that appears to relate to pre-commit hooks. I'm not sure what that configures, potentially the git-hooks package, but that isn't installed and also doesn't appear as actively maintained or widely used as Husky:

chooser/package.json

Lines 82 to 84 in 5359920

"gitHooks": {
"pre-commit": "lint-staged"
},

Implementation

  • I would be interested in implementing this feature.
@dijitali dijitali added ✨ goal: improvement Improvement to an existing feature 💻 aspect: code Concerns the software code in the repository 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🟩 priority: low Low priority and doesn't need to be rushed labels Apr 5, 2024
@TimidRobot TimidRobot added help wanted Open to participation from the community 🏁 status: ready for work Ready for work 🤖 aspect: dx Concerns developers' experience with the codebase and removed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Apr 8, 2024
@dijitali dijitali linked a pull request Apr 22, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🤖 aspect: dx Concerns developers' experience with the codebase ✨ goal: improvement Improvement to an existing feature help wanted Open to participation from the community 🟩 priority: low Low priority and doesn't need to be rushed 🏁 status: ready for work Ready for work
Projects
Status: Backlog
2 participants