TypeScript
Guida di stile TypeScript completa per progetti PANDEV, estende le convenzioni JavaScript con type safety e best practices.
๐ฏ Overview
TypeScript aggiunge type safety ai progetti JavaScript PANDEV. Questa guida copre:
Type System: Types, interfaces, generics
Framework Support: React, Vue, Angular, Node.js
Tools: TSC, ESLint, Prettier
Best Practices: Type safety, performance, maintainability
๐ Standard Adottati
Configurazione Base TypeScript
Utilizziamo strict mode per massima type safety:
// tsconfig.json
{
"compilerOptions": {
"strict": true,
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}ESLint TypeScript
Estende la configurazione JavaScript con regole TypeScript:
๐ ๏ธ Setup Rapido
1. Installazione Dependencies
2. File tsconfig.json PANDEV
3. Scripts Package.json
๐จ Framework-Specific Configurations
React + TypeScript
Vue + TypeScript
Angular + TypeScript
Node.js + TypeScript
๐ Type System Best Practices
1. Type Definitions
2. Utility Types
3. Type Guards
๐ฏ Naming Conventions
TypeScript Specific
๐ง Configuration Files
ESLint + TypeScript
Prettier TypeScript
๐ Performance & Best Practices
Compilation Performance
Type-only Imports
Strict Configurations
๐ Risorse
Documentazione Ufficiale
Framework Integration
Per configurazioni dettagliate e regole specifiche, consulta le sezioni dedicate:
Last updated
Was this helpful?