Skip to main content

Overview

Consistent code style makes the codebase easier to read, review, and maintain. Follow these guidelines for all contributions.

Frontend Style (React + TypeScript)

TypeScript

Strict Type Safety

Type Imports

React Components

Function Components

Props Interface

Hooks

Custom Hooks

Hook Dependencies

Import Conventions

Path Aliases

Always use @/* instead of relative paths:

Import Order

Tailwind CSS

Class Ordering

Use a consistent order:

Conditional Classes

Backend Style (Rust)

Formatting

Always run cargo fmt before committing:
Configuration (.rustfmt.toml):

Clippy Lints

Run cargo clippy to catch common issues:
Fix suggestions:

Error Handling

Result Types

Custom Errors

Async Code

Tauri Commands

Tokio Best Practices

State Management

Naming Conventions

Testing Patterns

Frontend Tests

Backend Tests

Documentation

TypeScript JSDoc

Rust Doc Comments

Pre-Commit Checks

Before every commit, run:
This runs:
  1. TypeScript - pnpm typecheck
  2. ESLint - pnpm lint
  3. Frontend tests - pnpm test run
  4. Backend tests - pnpm test:backend

Manual Checks

Editor Configuration

VS Code Settings

.vscode/settings.json:

Common Pitfalls

TypeScript

Rust

Next Steps