javascript-typescript

JavaScript & TypeScript

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "javascript-typescript" with this command: npx skills add kinhluan/skills/kinhluan-skills-javascript-typescript

JavaScript & TypeScript

Best practices for JavaScript and TypeScript development.

When to Use

  • Writing frontend or backend JavaScript/TypeScript code

  • Setting up new Node.js or browser projects

  • Code review and refactoring

TypeScript Guidelines

Strict Mode

Always enable strict mode in tsconfig.json :

{ "compilerOptions": { "strict": true, "noImplicitAny": true, "strictNullChecks": true } }

Type Best Practices

// Prefer interfaces for object shapes interface User { id: string; name: string; email: string; }

// Use union types for alternatives type Status = 'idle' | 'loading' | 'success' | 'error';

// Prefer readonly for immutable data class Config { readonly apiUrl: string; }

JavaScript Patterns

Async/Await

// Prefer async/await over promise chains async function fetchData(url) { const response = await fetch(url); return response.json(); }

Error Handling

try { await operation(); } catch (error) { logger.error('Operation failed', { error }); throw error; // Re-throw or handle }

Resources

  • TypeScript Handbook

  • MDN JavaScript Guide

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

c4-level4-code

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

python-development

No summary provided by upstream source.

Repository SourceNeeds Review
General

docker-containerization

No summary provided by upstream source.

Repository SourceNeeds Review
General

ddd-patterns

No summary provided by upstream source.

Repository SourceNeeds Review