Thank you for your interest in contributing to Vorsteh Queue! This document outlines our coding standards and contribution process.
-
Generic Type Parameters: Always prefix with
Tto distinguish from concrete types// ✅ Good interface BaseJob<TJobPayload = unknown> { payload: TJobPayload } function process<TJobPayload, TResult>(job: BaseJob<TJobPayload>): Promise<TResult> // ❌ Avoid interface BaseJob<JobPayload = unknown> { payload: JobPayload } function process<T, R>(job: BaseJob<T>): Promise<R>
-
Naming Conventions:
- Variables and functions:
camelCase - Types and interfaces:
PascalCase - Generic parameters:
Tprefix +PascalCase(e.g.,TJobPayload,TEventData)
- Variables and functions:
- Remove all
console.logstatements from production code - Use proper TypeScript types instead of
any - Prefer type-fest utility types over custom implementations
- Write self-documenting code with meaningful names
- Add JSDoc comments for public APIs
Follow this import order:
- Types first (with
import type) - React/Next.js/Expo (if applicable)
- Third-party modules
- @vorsteh-queue packages
- Relative imports (
~/,../,./)
Import Path Conventions:
- No file extensions: Never use
.js,.tsextensions - Prefer directory imports: Use
../srcinstead of../src/index - Avoid useless path segments: Skip
/indexwhen possible
- Fork the repository
- Create a feature branch from
main - Make your changes following the style guidelines
- Add tests for new functionality
- Ensure all tests pass:
pnpm test - Run type checking:
pnpm typecheck - Run linting:
pnpm lint - Fix format issues:
pnpm format:fix - Submit a pull request with a clear description
# Install dependencies
pnpm install
# Run tests
pnpm test
# Type check
pnpm typecheck
# Lint code
pnpm lintFeel free to open an issue for questions or discussions about contributing.