From 67dbcf76754bf3ecfd440a8dc77f72dc37d89f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20J=C3=A1ky?= Date: Mon, 22 Jul 2024 18:03:42 +0200 Subject: [PATCH] docs(ui): add Prettier to docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Jáky --- CONTRIBUTING.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a343967d9b..9b9f65ea9d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -83,7 +83,8 @@ use ( ./uibackend/server ./uibackend/types ./utils - ./workflow) + ./workflow +) ``` ### Running the VMClarity stack locally using Docker @@ -147,7 +148,7 @@ You must be logged into the docker registry locally before using this target. ran: - `make license-check` can be used to validate that all the files in the repo have the correctly formatted license -header. + header. - `make lint-actions` checks Github Actions workflow files. - `make lint-bicep` lints Bicep files. - `make lint-cfn` lints Cloudformation files. @@ -181,6 +182,24 @@ client and server code. - Run `make gen-bicep` for generating bicep files after modifying them for installing VMClarity on Azure. - Run `make gen-helm-docs` for generating the docs after making changes to VMClarity's Helm chart. +### Formatting + +Prettier is enabled (so you can use autoformatting plugins), and its use is enforced for files under the `ui/` +directory. For example you could use something similar in VSCode's `settings.json`: + +```json +} + "[javascriptreact]": { + "editor.formatOnSave": true, + "editor.formatOnType": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + ... +} +``` + +`make format` can be used to format everything at once with Prettier which is also being checked by the CI. + ### Testing End to End `make e2e-docker` can be used run the end-to-end tests in the repository locally using Docker. `make e2e-k8s` can also