From 7baed136b2e287c8a4f4f7f32c387cdce5f1458a Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Mon, 25 Sep 2023 17:55:19 +0200 Subject: [PATCH] Add instructions for local prettier linting (#1880) --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 3d27037e65..06595a5d42 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,25 @@ done fi ``` +### Lint JS and Markdown files with Prettier on save + +1. Install the [Prettier VS Code Extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode). +2. Run `npm install` in the docs folder you have the docs checked out in. +3. Inside VS code, open `settings.json` by pressing `CMD+SHIFT+P` and typing in settings and ensure the following settings are in the file: + +```json + "[markdown]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "prettier.configPath": ".prettierrc", + "prettier.documentSelectors": ["**/*.md"], + "prettier.prettierPath": "./node_modules/prettier/index.cjs", + "prettier.withNodeModules": true, + "prettier.resolveGlobalModules": true, + "prettier.requirePragma": true +``` + ## Publishing The docs are automatically published when a PR merges.