> For the complete documentation index, see [llms.txt](https://zzheng07.gitbook.io/flipted-backend/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zzheng07.gitbook.io/flipted-backend/best-practice/coding_style.md).

# Coding styles

1. Always add a return type to a function definition.

   > This is something that the compiler is able to figure out even we don't add a return type. However, by adding the return type, it's more human-readable.
2. Remove unused import statements
3. Remove unused variables, arguments.
4. Always format code with `prettier`
5. Catch `error` from async function

## References

* [Getting Started - Linting your TypeScript Codebase](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/docs/getting-started/linting/README.md)
* [The future of TypeScript on ESLint](https://eslint.org/blog/2019/01/future-typescript-eslint)
