Repository navigation
Expand file tree
/
Copy pathtsconfig.json
More file actions
27 lines (27 loc) · 1.74 KB
/
Copy pathtsconfig.json
File metadata and controls
27 lines (27 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
"compilerOptions": {
"types": ["jest", "node"],
"target": "ES2020", // Cấp độ ECMAScript mà mã sẽ được biên dịch tới
"module": "CommonJS", // Định dạng module, sử dụng ES modules (import/export)
"moduleResolution": "node",
"outDir": "./dist", // Thư mục đầu ra của file JavaScript biên dịch
"rootDir": "./src", // Thư mục gốc của mã nguồn TypeScript
"esModuleInterop": true, // Hỗ trợ import module theo chuẩn CommonJS
"forceConsistentCasingInFileNames": true, // Bắt buộc phân biệt chữ hoa chữ thường trong tên file
"strict": true, // Bật tất cả các kiểm tra chặt chẽ
"skipLibCheck": true, // Bỏ qua kiểm tra các file định nghĩa thư viện (.d.ts)
"noFallthroughCasesInSwitch": true, // Bắt lỗi case trong switch thiếu break/return
"noImplicitOverride": true, // Bắt buộc dùng `override` khi ghi đè method/property của lớp cha
"noUncheckedIndexedAccess": true, // Truy cập mảng/object qua index trả về thêm `| undefined`
"noPropertyAccessFromIndexSignature": true, // Bắt buộc dùng obj['prop'] thay vì obj.prop trên type có index signature
"noUnusedLocals": true, // Báo lỗi biến/import khai báo nhưng không dùng
"noUnusedParameters": true, // Báo lỗi tham số hàm khai báo nhưng không dùng (tiền tố `_` để bỏ qua có chủ đích)
"exactOptionalPropertyTypes": true, // Phân biệt rõ "thuộc tính vắng mặt" với "thuộc tính = undefined"
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"] // Các thư mục hoặc file bị loại trừ khỏi biên dịch
}