Naming Conventions
Overview
Conventions for naming files, variables, and object properties. Consistent naming makes the codebase scannable, searchable, and predictable. These rules apply to all TypeScript source files in the monorepo.
Rules
File Naming
Use kebab-case for all file names. Design file names with ls in mind — they should be scannable and sortable.
Correct
Incorrect
Variable Naming
Use camelCase for variables and function names.
Correct
Incorrect
Constant Naming
Use SCREAMINGSNAKECASE for constants. Group related constants in objects with as const.
Correct
Incorrect
Object Property Naming
Prefer nested objects when properties form a logical group. Use flat naming when the property is standalone or the object is a simple DTO.
Correct
Incorrect
Directory Structure
Prefer flat structure. Only nest when there are 5+ related files or clear sub-domain boundaries.
Correct
Incorrect
Module File Organization
Each module should have consistent file organization. Keep types in types.ts, export public API from index.ts, and keep internal types unexported.
Correct
Incorrect
References
- Functions -- Parameter naming conventions