Nhảy tới nội dung

Danh sách option

Thông tin mới nhất vui lòng tham khảo TypeScript TSConfig Reference.

Root option​

Các option ở root của TSConfig. Đây là các cấu hình liên quan đến toàn bộ project như file nào được type check.

Tên optionPhiên bản thêm vào
files-
extends2.1
include2.0
exclude-
references-

Type check​

Cấu hình liên quan đến type check.

Tên optionPhiên bản thêm vào
allowUnreachableCode1.8
allowUnusedLabels1.8
alwaysStrict2.1
exactOptionalPropertyTypes4.4
noFallthroughCasesInSwitch1.8
noimplicitany-
noimplicitoverride4.3
noImplicitReturns1.8
noimplicitthis2.0
nopropertyaccessfromindexsignature4.2
nouncheckedindexedaccess4.1
nounusedlocals2.0
nounusedparameters2.0
strict2.3
strictbindcallapply3.2
strictfunctiontypes2.6
strictnullchecks2.0
strictpropertyinitialization2.7
useunknownincatchvariables4.4

Module resolution​

Cấu hình liên quan đến module resolution của TypeScript compiler.

Tên optionPhiên bản thêm vào
allowArbitraryExtensions-
allowImportingTsExtensions-
allowUmdGlobalAccess3.5
baseUrl-
customConditions-
module1.0
moduleResolution-
moduleSuffixes4.7
noResolve-
paths-
resolveJsonModule-
resolvePackageJsonExports-
resolvePackageJsonImports-
rootDir1.5
rootDirs2.0
typeRoots-
types-

Output của type definition file và JavaScript file​

Cấu hình về cách output type definition file và JavaScript file.

Tên optionPhiên bản thêm vào
declaration1.0
declarationDir2.0
declarationMap2.9
downlevelIteration2.3
emitBOM-
emitDeclarationOnly2.8
importHelpers-
importsNotUsedAsValues3.8
inlineSourceMap1.5
inlineSources1.5
mapRoot-
newLine1.5
noEmit-
noEmitHelpers1.5
noEmitOnError1.4
outDir-
outFile1.0
preserveConstEnums-
preserveValueImports4.5
removeComments-
sourceMap-
sourceRoot-
stripInternal-

Hỗ trợ JavaScript​

Cấu hình liên quan đến xử lý JavaScript thuần.

Tên optionPhiên bản thêm vào
allowJs1.8
checkJs2.3
maxNodeModuleJsDepth-

Hỗ trợ editor​

Cấu hình về hành vi của TypeScript trong editor.

Tên optionPhiên bản thêm vào
disableSizeLimit-
plugins-

Ràng buộc về khả năng tương thích​

Cấu hình liên quan đến khả năng tương thích như tương tác giữa ESModule và CommonJS, phân biệt chữ hoa chữ thường của file khi phát triển trên các file system khác nhau.

Tên optionPhiên bản thêm vào
allowSyntheticDefaultImports1.8
esModuleInterop2.7
forceConsistentCasingInFileNames-
isolatedModules1.5
preserveSymlinks-
verbatimModuleSyntax-

Hỗ trợ backward compatibility​

Cấu hình để hỗ trợ các phiên bản cũ hơn của TypeScript.

Tên optionPhiên bản thêm vào
charset-
keyofStringsOnly2.9
noImplicitUseStrict-
noStrictGenericChecks2.4
out-
suppressExcessPropertyErrors-
suppressImplicitAnyIndexErrors-

Ngôn ngữ và cấu hình môi trường​

Cấu hình liên quan đến các tính năng ngôn ngữ thử nghiệm như decorator và cú pháp JSX.

Tên optionPhiên bản thêm vào
emitDecoratorMetadata-
experimentalDecorators-
jsx2.2
jsxFactory-
jsxFragmentFactory4.0
jsxImportSource4.1
lib2.0
moduleDetection4.7
noLib-
reactNamespace-
target1.0
useDefineForClassFields3.7

Thông tin chẩn đoán của compiler​

Cấu hình liên quan đến thông tin chẩn đoán của compiler như profiling compile.

Tên optionPhiên bản thêm vào
diagnostics-
explainFiles4.2
extendedDiagnostics-
generateCpuProfile3.7
listEmittedFiles-
listFiles-
traceResolution2.0

Project​

Cấu hình liên quan đến TypeScript Project References.

Tên optionPhiên bản thêm vào
composite3.0
disableReferencedProjectLoad4.0
disableSolutionSearching3.8
disableSourceOfProjectReferenceRedirect3.7
incremental3.4
tsBuildInfoFile3.4

Output format​

Cấu hình liên quan đến output format.

Tên optionPhiên bản thêm vào
noErrorTruncation-
preserveWatchOutput-
pretty-

Độ đầy đủ của type check​

Cấu hình liên quan đến độ nghiêm ngặt của type check.

Tên optionPhiên bản thêm vào
skipDefaultLibCheck-
skipLibCheck2.0

File watching​

Cấu hình liên quan đến file watching.

Tên optionPhiên bản thêm vào
assumeChangesOnlyAffectDirectDependencies3.8
watchFile3.8
watchDirectory3.8
fallbackPolling3.8
synchronousWatchDirectory-
excludeDirectories-
excludeFiles-

Lấy type​

Cấu hình liên quan đến download type trong JavaScript project.

Tên optionPhiên bản thêm vào
enable-
include-
exclude-
disableFilenameBasedTypeAcquisition4.1