To maintain consistency and readability across the project, Rocket.Chat has established specific coding conventions and formatting rules. This guide provides a brief overview of these guidelines, focusing on the use of different languages and formatting tools in the Rocket.Chat codebase.

Rocket.Chat primarily uses Visual Studio Code (VSCode) as its text editor of choice due to its wide usage and versatility. To ensure uniformity in code formatting, Rocket.Chat employs the Prettier plugin. As long as you use it, the code style will be automatically adhered to Rocket.Chat standards. Specific language configurations are in the .editorconfig.

We provide a prettier config and eslint config in our repos, so as long as those plugins are installed on your editor, code style will be automatically followed

TypeScript: ESLint is responsible for formatting all JavaScript and TypeScript code. Rocket.Chat has transitioned to using only TypeScript (.ts) files in its codebase. Conventions for TypeScript, React, and Components are specified in the Fuselage Conventions, ensuring that all contributors follow the same standards.

Go: For code written in Go, the the gofmt formatter should be used to ensure proper formatting.

Shell Script: For Shell-related code, the shfmt formatter should be used.

These formatters help maintain a consistent style across different languages used in the Rocket.Chat codebase.

Contributing to Rocket.Chat involves more than just writing code; it's about adhering to established conventions and maintaining a consistent style across the project. By using tools like VSCode, Prettier, ESLint, gofmt, and shfmt, developers can ensure their contributions align with the existing codebase. This consistency not only makes the code easier to read and understand but also facilitates collaboration among contributors from around the world. Happy coding!

For a comprehensive understanding of Rocket.Chat's coding conventions and style, refer to and Code Style Guide.

Last updated

Rocket.Chat versions receive support for six months after release.