Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 1.46 KB

File metadata and controls

65 lines (50 loc) · 1.46 KB

Coding Standards

TypeScript Style

// ✅ Good: Type-safe, clear naming
export interface Bundle {
    id: string;
    name: string;
    version: string;
}

// ❌ Bad: Any types, unclear names
async function fetch(id: any): Promise<any> { }

Naming

Element Convention Example
Classes PascalCase GitHubAdapter
Functions camelCase fetchBundles
Constants UPPER_SNAKE_CASE DEFAULT_TIMEOUT
Files Match class or camelCase GitHubAdapter.ts

Imports

// External
import * as vscode from 'vscode';
// Internal
import { Logger } from '../utils/logger';
// Types
import { Bundle } from '../types/registry';

Error Handling

try {
    const data = await api.fetch();
} catch (error) {
    logger.error('Failed to fetch', error as Error);
    throw new Error('Fetch failed');
}

Commit Messages

Follow the conventionnal commits from the opensource world Conventional Commits

PR Checklist

Have a look at the pull_request_template

  • Code follows style guidelines
  • Tests added
  • Documentation updated
  • Manual testing of the functionnality done
  • No new warnings

See Also