docs: Document that we use Prettier.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-07-22 12:25:49 -07:00 committed by Tim Abbott
parent bc7bec9a95
commit ab6ed22bff
3 changed files with 9 additions and 13 deletions

View File

@ -11,6 +11,7 @@ largest and fastest growing open source group chat project.
[![CircleCI branch](https://img.shields.io/circleci/project/github/zulip/zulip/master.svg)](https://circleci.com/gh/zulip/zulip/tree/master)
[![Coverage Status](https://img.shields.io/codecov/c/github/zulip/zulip/master.svg)](https://codecov.io/gh/zulip/zulip/branch/master)
[![Mypy coverage](https://img.shields.io/badge/mypy-100%25-green.svg)][mypy-coverage]
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![GitHub release](https://img.shields.io/github/release/zulip/zulip.svg)](https://github.com/zulip/zulip/releases/latest)
[![docs](https://readthedocs.org/projects/zulip/badge/?version=latest)](https://zulip.readthedocs.io/en/latest/)
[![Zulip chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://chat.zulip.org)

View File

@ -251,19 +251,11 @@ code a lot uglier, in which case it's fine to go up to 120 or so.
### JavaScript and TypeScript
When calling a function with an anonymous function as an argument, use
this style:
my_function('foo', data => {
var x = ...;
// ...
});
The inner function body is indented one level from the outer function
call. The closing brace for the inner function and the closing
parenthesis for the outer call are together on the same line. This style
isn't necessarily appropriate for calls with multiple anonymous
functions or other arguments following them.
Our JavaScript and TypeScript code is formatted with
[Prettier](https://prettier.io/). You can ask Prettier to reformat
all code via our [linter tool](../testing/linters.md) with `tools/lint
--only=prettier --fix`. You can also [integrate it with your
editor](https://prettier.io/docs/en/editors.html).
Combine adjacent on-ready functions, if they are logically related.

View File

@ -19,6 +19,7 @@ below will direct you to the official documentation for these projects.
- [eslint](https://eslint.org)
- [mypy](http://mypy-lang.org/)
- [Prettier](https://prettier.io/)
- [puppet](https://puppet.com/) (puppet provides its own mechanism for
validating manifests)
- [pyflakes](https://pypi.python.org/pypi/pyflakes)
@ -100,6 +101,7 @@ following checks:
- Check Python code with pyflakes.
- Check JavaScript and TypeScript code with eslint.
- Check JavaScript, TypeScript, and YAML formatting with Prettier.
- Check Python code for custom Zulip rules.
- Check non-Python code for custom Zulip rules.
- Check puppet manifests with the puppet validator.
@ -184,6 +186,7 @@ that we exempt may be deemed not worthwhile to fix.
We check our JavaScript code in a few different ways:
- We run eslint.
- We check code formatting with Prettier.
- We perform custom Zulip regex checks on the code.
#### Puppet manifests