Skip to the content.

Frontend Development Standards

A unified guide for writing consistent, maintainable, and scalable frontend code. Built for clarity, designed for collaboration.

Audience: Engineering Team
Document Type: Coding Standards
Status: Active · Living Document


Table of Contents

  1. Code Quality & Safety
  2. File Structure & Organization
  3. Naming Conventions
  4. Styling Standards
  5. Component Design Principles
  6. React Best Practices
  7. Accessibility (a11y)
  8. Performance
  9. Code Hygiene
  10. Git & PR Practices
  11. Documentation

1. Code Quality & Safety

1.1 Error Handling

1.2 Optional Chaining

1.3 Type Safety


2. File Structure & Organization

2.1 File Size Limit

2.2 Component Folder Structure

If a component has child components, it should reside in its own folder with the following structure:

ComponentName/
├── index.tsx              // Main component
├── components/            // Child components
│   ├── ChildA.tsx
│   └── ChildB.tsx
├── hooks/                 // Component-specific hooks
├── utils/                 // Component-specific utilities
└── types.ts               // Component-specific types

2.3 Imports


3. Naming Conventions

Entity Convention Example
.tsx Component Files PascalCase UserProfileCard.tsx
Functions / Methods camelCase fetchUserDetails()
Utilities / Helpers camelCase formatDate()
Types / Interfaces PascalCase UserProfile, IApiResponse
Enums PascalCase (members UPPER_SNAKE_CASE) UserRole.ADMIN
Constants UPPER_SNAKE_CASE MAX_RETRY_COUNT
CSS Class Names kebab-case user-card-wrapper

💡 Pro Tip: Consistent naming is the foundation of readable code. When in doubt, follow the patterns established in the existing codebase rather than introducing new conventions.


4. Styling Standards

4.1 Tailwind First

4.2 Units

4.3 Text Color Hierarchy

For non-branding text, default to muted tones using Tailwind’s zinc or gray palette. Use only the following text color classes:

Class Hex Usage
text-zinc-700 #3f3f46 Titles and primary headings
text-zinc-600 #52525b Body text, primary content
text-zinc-500 #71717a Descriptions, secondary text

ℹ️ Reserved: text-zinc-400 is reserved exclusively for icons, muted/disabled text, and disabled button labels.

⛔ Do Not Use: text-zinc-900 (or any 800+ shade) — it is too heavy for our visual style and breaks the muted, balanced look of the application.


5. Component Design Principles

5.1 Single Responsibility

5.2 Props Discipline

5.3 State Management


6. React Best Practices

6.1 Hooks

6.2 Memoization

6.3 Keys in Lists


7. Accessibility (a11y)


8. Performance


9. Code Hygiene


10. Git & PR Practices

10.1 Conventional Commits

Commit messages should follow the conventional commits format. Use the appropriate tag based on the nature of the change:

Tag Meaning
feat: A new feature or capability added to the codebase.
fix: A bug fix that resolves an issue in existing functionality.
refactor: Code changes that neither fix a bug nor add a feature (restructuring, renaming, cleanup).
chore: Maintenance work like dependency upgrades, config changes, or housekeeping.
style: Code style changes — formatting, whitespace, missing semicolons, etc. (no logic change).
docs: Documentation-only changes such as updates to README, comments, or guides.
perf: A code change that improves performance.
test: Adding new tests or correcting existing ones.
build: Changes to build system, bundlers, or external dependencies (webpack, npm, etc.).
ci: Changes to CI configuration files and scripts (GitHub Actions, Jenkins, etc.).
revert: Reverts a previous commit.

10.2 Pull Requests


11. Documentation

📝 Personal Reminder: If you’re someone who easily forgets what your own code does after a few weeks, make sure to add proper comments — especially for functions, utilities, Redux slices, and custom hooks. Use JSDoc notation and always include an example. Future-you (and the team) will thank you.

11.1 JSDoc Example

/**
 * Formats a date string into a human-readable format.
 *
 * @param date - ISO date string or Date object to format.
 * @param locale - Optional locale identifier (defaults to 'en-US').
 * @returns Formatted date string (e.g., "May 28, 2026").
 *
 * @example
 * formatDate("2026-05-28");           // "May 28, 2026"
 * formatDate(new Date(), "en-GB");    // "28 May 2026"
 */
export const formatDate = (date: string | Date, locale = "en-US"): string => {
  // implementation...
};

Following this pattern makes your code self-documenting and dramatically reduces ramp-up time for anyone (including yourself) revisiting the code later.


Last updated: June 2026