Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.3 KB

STYLE_GUIDE.md

File metadata and controls

55 lines (40 loc) · 1.3 KB

Style Guide

Naming Conventions

  • Use meaningful and descriptive names for variables, functions, and classes.
  • Use CamelCase for classes, functions and variables.
  • Use uppercase for constants.

Typescript

  • Use const for variables that are not reassigned and let for variables that are reassigned.
const myVar = "foo";
let myOtherVar = "bar";
  • Use === and !== for equality and inequality comparisons.
if (myVar === myOtherVar) {
  console.log("They are equal!");
} else {
  console.log("They are not equal!");
}
  • Use arrow functions for anonymous functions.
const myFunc = () => {
  console.log("Hello World!");
};
  • Use async/await for asynchronous code.
const myAsyncFunc = async () => {
  await someAsyncOperation();
  console.log("Done!");
};

Miscellaneous

  • Keep code DRY (Don't Repeat Yourself).
  • Avoid long functions or methods.
  • Avoid magic numbers or hard-coded values.
  • Write code that is easy to read and understand.
  • Follow established conventions and patterns within the codebase.

Conclusion

By following these guidelines, we can create code that is consistent, maintainable, and easy to read. If you have any questions or suggestions for improving the style guide, please reach out to the project maintainers.