Code Standards

Coding conventions and PR process for Refresh App Web.

TypeScript Standards

Strict Mode

{
	"compilerOptions": {
		"strict": true,
		"noUnusedLocals": true,
		"noUnusedParameters": true,
		"noImplicitReturns": true
	}
}

Type Annotations

// ✅ Good - explicit types
function calculateTotal(items: Item[]): number {
	return items.reduce((sum, item) => sum + item.price, 0);
}

// ❌ Avoid - implicit any
function process(data) {
	return data.map((item) => item.value);
}

Interfaces vs Types

Use interfaces for object shapes:

Use types for unions/intersections:

Svelte 5 Standards

Use Runes

Props

Event Handlers

File Organization

Naming Conventions

  • Components: PascalCase (Button.svelte, UserCard.svelte)

  • Files: kebab-case (user-utils.ts, auth-helpers.ts)

  • Functions: camelCase (getUserById, calculateTotal)

  • Constants/Enums: UPPER_SNAKE_CASE (MAX_ITEMS, API_ENDPOINT)

  • Types/Interfaces: PascalCase (User, ApiResponse)

Formatting

Configuration: .prettierrc

Linting

Configuration: eslint.config.js

Git Workflow

Branch Naming

  • feature/description - New features

  • fix/description - Bug fixes

  • refactor/description - Code refactoring

  • docs/description - Documentation

  • test/description - Tests

Commit Messages

Follow Conventional Commitsarrow-up-right:

PR Process

  1. Create branch from main

  2. Make changes

  3. Run tests: pnpm test && pnpm check

  4. Format code: pnpm format

  5. Commit with conventional message

  6. Push to GitHub

  7. Create PR with description

  8. Wait for CI/CD checks

  9. Request review

  10. Address feedback

  11. Squash and merge

PR Template

Code Review Guidelines

As Author:

  • Keep PRs small (<500 lines)

  • Write descriptive PR description

  • Add screenshots for UI changes

  • Respond to feedback promptly

As Reviewer:

  • Be constructive and kind

  • Test the changes locally

  • Check for edge cases

  • Approve when ready


Last updated: October 2025

Last updated