From 5a406e0d3c8b6b6d7cdf98543988340254daa531 Mon Sep 17 00:00:00 2001 From: Andreas Svanberg <andreass@dsv.su.se> Date: Wed, 4 Dec 2024 12:02:49 +0100 Subject: [PATCH] Update instructions for how to get Prettier to format on save IntelliJ requires Node.js to be installed for it to be able to run Prettier and format the code. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index dc2b0cb977..52cb4b05d7 100644 --- a/README.md +++ b/README.md @@ -23,5 +23,9 @@ An easier way to reformat code is to set IntelliJ to do it on save. Go to `Settings -> Language & Frameworks -> JavaScript -> Prettier` and then check `Automatic Prettier Configuration`, set `Run for files` to `**/*.{java}`, and finally check `Run on save`. +For this to work you also need to have [Node.js](https://nodejs.org) +installed and configured under `Settings -> Language & Frameworks -> Node.js` +and the file you're saving *must* be able to compile otherwise no formatting +can be performed. The formatting is validated by CI, but you should do it beforehand with a simple `./mvnw verify -pl .`.