.. SPDX-FileCopyrightText: 2021 Veit Schiele .. .. SPDX-License-Identifier: BSD-3-Clause ``prettier`` ============ `prettier `_ offers automatic formatters for other file types, including `TypeScript `_, `JSON `_, `Vue `_, `YAML `_, `TOML `_ and `XML `_. Installation ------------ .. code-block:: console $ npm install prettier --save-dev --save-exact Configuration ------------- .. code-block:: console $ npx prettier --write path/to/my/file.js Pre-commit hook for ``prettier`` -------------------------------- Installation ~~~~~~~~~~~~ .. code-block:: console $ npm install pretty-quick husky --save-dev Configuration ~~~~~~~~~~~~~ In the ``package.json`` file you can configure the pre-commit hook as follows: .. code-block:: json { "husky": { "hooks": { "pre-commit": "pretty-quick --staged" } } } .. seealso:: * `Prettier docs `_