Coding standards and style guide
C++ code
quick-lint-js’ C++ code is formatted using the clang-format tool, version 9.0.x. During development, use clang-format in one of two ways:
-
Install clang-format
yourself, then run the
tools/format
script to format all of quick-lint-js’ code with one command. - Run clang-format in your editor (CLion, Emacs, Vim, Visual Studio, Visual Studio Code). Be sure to use version 9.0.x, or you might have problems with the CI clang-format checker.
JavaScript and HTML
quick-lint-js’ web code (CSS, HTML, and JavaScript) is formatted using the Prettier tool. During development, use Prettier in one of two ways:
-
In the
plugin/vscode
,plugin/vscode-lsp
,wasm
, orwebsite
directory, install Prettier withyarn install
then run it withyarn fmt
. This formats all of quick-lint-js’ code in that subproject with one command. -
Run Prettier in your editor with
Prettier editor integration. You need to run
yarn install
in the subproject’s directory in order for editor integration to work.