Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 2.37 KB

naming-conventions.md

File metadata and controls

62 lines (43 loc) · 2.37 KB

Naming Conventions

This document outlines the naming conventions to be followed for files, folders, and variables in the monorepo-one project. Consistent naming conventions help improve readability, maintainability, and collaboration within the project.

File Naming Conventions

  • Use kebab-case for filenames.
    • Example: user-profile.ts
  • Use descriptive names that clearly indicate the purpose of the file.
    • Example: user-service.ts instead of service.ts

Folder Naming Conventions

  • Use kebab-case for folder names.
    • Example: user-services
  • Group related files into folders based on their functionality or domain.
    • Example: services/user-services

Variable Naming Conventions

  • Use camelCase for variable names.
    • Example: userName, totalPrice
  • Use descriptive names that clearly indicate the purpose of the variable.
    • Example: userAge instead of age

Class Naming Conventions

  • Use PascalCase for class names.
    • Example: UserProfile, ShoppingCart
  • Use descriptive names that clearly indicate the purpose of the class.
    • Example: OrderService instead of Service

Constant Naming Conventions

  • Use UPPER_CASE for constants.
    • Example: MAX_USERS, DEFAULT_TIMEOUT
  • Use descriptive names that clearly indicate the purpose of the constant.
    • Example: MAX_RETRIES instead of RETRIES

Function Naming Conventions

  • Use camelCase for function names.
    • Example: calculateTotal, getUserById
  • Use descriptive names that clearly indicate the purpose of the function.
    • Example: fetchUserData instead of fetchData

Interface and Type Naming Conventions

  • Use PascalCase for interfaces and type definitions.
    • Example: UserProfile, OrderDetails
  • Use descriptive names that clearly indicate the purpose of the interface or type.
    • Example: UserAddress instead of Address

Additional Guidelines

  • Avoid abbreviations and acronyms unless they are well-known and widely accepted.
    • Example: HTMLParser instead of HP
  • Be consistent with naming conventions throughout the project.
  • Regularly review and update naming conventions as the project evolves.

By following these naming conventions, we can ensure that our codebase remains clean, readable, and maintainable. Consistent naming conventions also facilitate collaboration and make it easier for new team members to understand the code.