Updated TypeScript Style Guide (markdown)
@@ -151,7 +151,6 @@ let selectedCourse: Course | null = null;
|
|||||||
```typescript
|
```typescript
|
||||||
// Good
|
// Good
|
||||||
const courseList = [];
|
const courseList = [];
|
||||||
const activeSchedule = schedules[0];
|
|
||||||
function getCourseById(id: number) {}
|
function getCourseById(id: number) {}
|
||||||
async function fetchCourses() {}
|
async function fetchCourses() {}
|
||||||
|
|
||||||
@@ -167,7 +166,6 @@ function GetCourseById(id: number) {}
|
|||||||
// Good
|
// Good
|
||||||
const MAX_COURSES = 10;
|
const MAX_COURSES = 10;
|
||||||
const API_URL = 'https://api.example.com';
|
const API_URL = 'https://api.example.com';
|
||||||
const CACHE_TTL = 3600;
|
|
||||||
|
|
||||||
// Bad
|
// Bad
|
||||||
const maxCourses = 10;
|
const maxCourses = 10;
|
||||||
@@ -208,7 +206,7 @@ class Course {
|
|||||||
|
|
||||||
### Import Order
|
### Import Order
|
||||||
|
|
||||||
Organize imports in this order:
|
Imports should automatically be organized through the linter. For reference, organize imports in this order:
|
||||||
|
|
||||||
1. External libraries
|
1. External libraries
|
||||||
2. Internal absolute imports
|
2. Internal absolute imports
|
||||||
|
|||||||
Reference in New Issue
Block a user