Dear fellow contributors,
if you are contributing to Flarum's JavaScript code, please be aware that we are now using Prettier to auto-format our JS files.
How will this affect you?
- Local development: please ensure your JS dependencies are up-to-date (
npm install). This should automatically set up Git hooks using husky, which will run Prettier before you make a commit. (If it doesn't seem to work, please make sure your Git and Node versions fulfill husky's minimum requirements.)
- Contributing: When sending a PR to Flarum, the builds will fail if code has not been formatted locally. To do so, set up Git hooks or run
npm run format locally and commit the results.
- Existing PRs with JS changes: Those probably now have conflicts, but they should be easy to resolve. I will go through them all and post instructions for resolution, if necessary.
Thanks for your attention! 🎤