// ✅ 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> { }| Element | Convention | Example |
|---|---|---|
| Classes | PascalCase |
GitHubAdapter |
| Functions | camelCase |
fetchBundles |
| Constants | UPPER_SNAKE_CASE |
DEFAULT_TIMEOUT |
| Files | Match class or camelCase |
GitHubAdapter.ts |
// External
import * as vscode from 'vscode';
// Internal
import { Logger } from '../utils/logger';
// Types
import { Bundle } from '../types/registry';try {
const data = await api.fetch();
} catch (error) {
logger.error('Failed to fetch', error as Error);
throw new Error('Fetch failed');
}Follow the conventionnal commits from the opensource world Conventional Commits
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
- Development Setup
- Testing
- CONTRIBUTING.md - Full contribution guidelines