Skip to main content

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

ElementConventionExample
ClassesPascalCaseGitHubAdapter
FunctionscamelCasefetchBundles
ConstantsUPPER_SNAKE_CASEDEFAULT_TIMEOUT
FilesMatch class or camelCaseGitHubAdapter.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