Skip to content

Commit 9202bef

Browse files
committed
Document how to run Prettier code formatter
1 parent 3aa642f commit 9202bef

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* All tests pass locally.
66
* On CI, all jobs succeed, including the Linux, macOS, Windows, and WASM builds.
77
* C++ code is formatted using [clang-format](#clang-format).
8+
* CSS, HTML, and JavaScript code is formatted using [Prettier](#Prettier).
89

910
## clang-format
1011

@@ -26,3 +27,18 @@ quick-lint-js' C++ code is formatted using the [clang-format][] tool, **version
2627
[clang-format-vscode]: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
2728
[clang-format]: https://clang.llvm.org/docs/ClangFormat.html
2829
[llvm-build-9.0.0]: https://releases.llvm.org/download.html#9.0.0
30+
31+
## Prettier
32+
33+
quick-lint-js' web code (CSS, HTML, and JavaScript) is formatted using the
34+
[Prettier][] tool. During development, use Prettier in one of two ways:
35+
36+
* In the `plugin/vscode`, `plugin/vscode-lsp`, `wasm`, or `website` directory,
37+
install Prettier with `yarn install` then run it with `yarn fmt`. This formats
38+
all of quick-lint-js' code in that subproject with one command.
39+
* Run Prettier in your editor with [Prettier editor
40+
integration][Prettier-editor]. You need to run `yarn install` in the
41+
subproject's directory in order for editor integration to work.
42+
43+
[Prettier]: https://prettier.io/
44+
[Prettier-editor]: https://prettier.io/docs/en/editors.html

0 commit comments

Comments
 (0)