Warning
🚧 Work in Progress: This page is currently under construction. Content may be incomplete or subject to change. To contribute, see the contribution guide.
JavaScript / TypeScript Standards
Tools
Minimum configuration
// .prettierrc
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}Best practices
- TypeScript preferred over plain JavaScript for new projects
- async/await preferred over callbacks or
.then()chains - Error handling mandatory for API calls and I/O operations
// ✅ CORRECT
async function fetchData(endpoint: string): Promise<DataItem[]> {
try {
const response = await fetch(endpoint);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (error) {
console.error('Error fetching data:', error);
throw error;
}
}