When naming branches, it's important to use a clear and consistent naming convention to help you and your team members understand what each branch is for. Here are some tips for naming branches:
- Use a prefix to indicate the type of branch, such as:
- feat/ for new features
- fix/ for bugfixes
- chore/ for maintenance tasks
- doc/ for documentation changes
- test/ for test code changes
- refactor/ for code refactoring
- style/ for code style changes
- Use a short but descriptive name for the branch that summarizes its purpose, such as:
- feat/user-profile-page
- fix/login-issue
- chore/update-dependencies
- doc/api-documentation
- test/user-tests
- refactor/payment-module
- style/header-styling
Use lowercase letters and hyphens to separate words in the branch name.
Avoid using special characters or spaces in the branch name.
Here's an example of a well-named branch: feat/add-shopping-cart-functionality.
- Use camelCase for variable names
- Use PascalCase for class, filenames and model names
- Use lowercase for folder names
- Use snake_case for database table names and column names
- Use singular names for models/tables
- Avoid using
var
keyword (useconst
andlet
keywords) and outdated syntax, avoid taking shortcuts - Use
async/await
instead ofthen/catch
for asynchronous code - Use
try/catch
for error handling - Avoid writing large functions in managers, use controllers for that
- Use Interactors for DB Operations
- Avoid cyclic dependencies
- Use Prettier for code formatting and linting
- Use JSCPD for code duplication check
- Use ExpressValidator for validation in routes
- Use
console.error
for logging errors - Use Constants file for storing static values, avoid tables for such values
- Avoid using string comparisons, use Constants instead
- Use
==
instead of===
for comparing values - DO NOT USE
wagner
for any purposes, seek alternatives - Use proper comments for functions and classes (use JSDoc if possible)
- Avoid cluttering different functions with different uses withing a single file/folder, make separate files/folders for different purposes