Code Conventions

Description of general coding style/conventions to follow.

Please read over this once before you begin working on our codebase.

Git

  • Name Git branches with kebab-case (dashes between words)

    • Prefix branches with their category and a forward slash

      • For example: feat/frontend-tailwindcss for a feature branch that integrates TailwindCSS into the frontend

      • Branches without a prefix are permanent branches with specific use cases and should NOT be deleted

  • Name Git commits with a short description of changes that were done

    • For example: Added /user/{id}/userProfile endpoint

JSX/TSX

  • Name variables with camelCase (first word uncapitalized, all subsequent words capitalized)

    • For example: projectList

  • Name global constants with capitalized snake_case (underscores between words)

    • For example: MAX_PROJECTS

    • This does not apply to just "const" variables that are used to indicate immutability

      • For example: const navigate = useNavigate();

      • You should be using const instead of let whenever possible to indicate mutability

CSS

  • For projects with TailwindCSS, try to maintain inline styles in the same order

    • If inline styles are repeatedly used (for example, a button may have a set of inline styles), please factor those out into a class under the Tailwind @components layer

  • For projects with custom CSS, use kebab-case for class names

Last updated