---
description:
globs:
alwaysApply: true
---
# Code conventions
## Coding guidelines
We follow these guidelines:
- Make sure to use full, named functions, _NOT_ arrow functions, unless they're inline callbacks.
- Place functions in the order they are used. That means the definition of a function is placed after the location from where it is called. Local functions _MUST_ to be placed at the end of the parent function, that means even after the return statement if there is one.
- For new packages, _ALWAYS_ ask for permission to add them. Try to avoid them as much as possible unless it's a really necessary one. Often it's just better to do it ourselves.
- Don't use excessive commenting. A comment should only be used if it's not possible to use names and code structure to explain the same thing.
- There mustn't be any linter or type errors or warnings.
- If there is an error, make sure to show a clear message to the user.
- We write suitable tests to cover all new functionality we add.
## Other notes
- All tests should pass before we say we're done with a task.
- Git commit messages should have titles that are no longer than 50 characters and a description that wraps at 72 characters.