tsconfig.json文件翻译

原文件

{
  "compilerOptions": {
    /* Visit https://aka.ms/tsconfig to read more about this file */

    /* Projects */
    // "incremental": true,                              /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
    // "composite": true,                                /* Enable constraints that allow a TypeScript project to be used with project references. */
    // "tsBuildInfoFile": "./.tsbuildinfo",              /* Specify the path to .tsbuildinfo incremental compilation file. */
    // "disableSourceOfProjectReferenceRedirect": true,  /* Disable preferring source files instead of declaration files when referencing composite projects. */
    // "disableSolutionSearching": true,                 /* Opt a project out of multi-project reference checking when editing. */
    // "disableReferencedProjectLoad": true,             /* Reduce the number of projects loaded automatically by TypeScript. */

    /* Language and Environment */
    "target": "es2016",                                  /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
    // "lib": [],                                        /* Specify a set of bundled library declaration files that describe the target runtime environment. */
    // "jsx": "preserve",                                /* Specify what JSX code is generated. */
    // "experimentalDecorators": true,                   /* Enable experimental support for legacy experimental decorators. */
    // "emitDecoratorMetadata": true,                    /* Emit design-type metadata for decorated declarations in source files. */
    // "jsxFactory": "",                                 /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
    // "jsxFragmentFactory": "",                         /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
    // "jsxImportSource": "",                            /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
    // "reactNamespace": "",                             /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
    // "noLib": true,                                    /* Disable including any library files, including the default lib.d.ts. */
    // "useDefineForClassFields": true,                  /* Emit ECMAScript-standard-compliant class fields. */
    // "moduleDetection": "auto",                        /* Control what method is used to detect module-format JS files. */

    /* Modules */
    "module": "commonjs",                                /* Specify what module code is generated. */
    // "rootDir": "./",                                  /* Specify the root folder within your source files. */
    // "moduleResolution": "node10",                     /* Specify how TypeScript looks up a file from a given module specifier. */
    // "baseUrl": "./",                                  /* Specify the base directory to resolve non-relative module names. */
    // "paths": {},                                      /* Specify a set of entries that re-map imports to additional lookup locations. */
    // "rootDirs": [],                                   /* Allow multiple folders to be treated as one when resolving modules. */
    // "typeRoots": [],                                  /* Specify multiple folders that act like './node_modules/@types'. */
    // "types": [],                                      /* Specify type package names to be included without being referenced in a source file. */
    // "allowUmdGlobalAccess": true,                     /* Allow accessing UMD globals from modules. */
    // "moduleSuffixes": [],                             /* List of file name suffixes to search when resolving a module. */
    // "allowImportingTsExtensions": true,               /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
    // "resolvePackageJsonExports": true,                /* Use the package.json 'exports' field when resolving package imports. */
    // "resolvePackageJsonImports": true,                /* Use the package.json 'imports' field when resolving imports. */
    // "customConditions": [],                           /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
    // "resolveJsonModule": true,                        /* Enable importing .json files. */
    // "allowArbitraryExtensions": true,                 /* Enable importing files with any extension, provided a declaration file is present. */
    // "noResolve": true,                                /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */

    /* JavaScript Support */
    // "allowJs": true,                                  /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
    // "checkJs": true,                                  /* Enable error reporting in type-checked JavaScript files. */
    // "maxNodeModuleJsDepth": 1,                        /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */

    /* Emit */
    // "declaration": true,                              /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
    // "declarationMap": true,                           /* Create sourcemaps for d.ts files. */
    // "emitDeclarationOnly": true,                      /* Only output d.ts files and not JavaScript files. */
    // "sourceMap": true,                                /* Create source map files for emitted JavaScript files. */
    // "inlineSourceMap": true,                          /* Include sourcemap files inside the emitted JavaScript. */
    // "outFile": "./",                                  /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
    // "outDir": "./",                                   /* Specify an output folder for all emitted files. */
    // "removeComments": true,                           /* Disable emitting comments. */
    // "noEmit": true,                                   /* Disable emitting files from a compilation. */
    // "importHelpers": true,                            /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
    // "importsNotUsedAsValues": "remove",               /* Specify emit/checking behavior for imports that are only used for types. */
    // "downlevelIteration": true,                       /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
    // "sourceRoot": "",                                 /* Specify the root path for debuggers to find the reference source code. */
    // "mapRoot": "",                                    /* Specify the location where debugger should locate map files instead of generated locations. */
    // "inlineSources": true,                            /* Include source code in the sourcemaps inside the emitted JavaScript. */
    // "emitBOM": true,                                  /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
    // "newLine": "crlf",                                /* Set the newline character for emitting files. */
    // "stripInternal": true,                            /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
    // "noEmitHelpers": true,                            /* Disable generating custom helper functions like '__extends' in compiled output. */
    // "noEmitOnError": true,                            /* Disable emitting files if any type checking errors are reported. */
    // "preserveConstEnums": true,                       /* Disable erasing 'const enum' declarations in generated code. */
    // "declarationDir": "./",                           /* Specify the output directory for generated declaration files. */
    // "preserveValueImports": true,                     /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */

    /* Interop Constraints */
    // "isolatedModules": true,                          /* Ensure that each file can be safely transpiled without relying on other imports. */
    // "verbatimModuleSyntax": true,                     /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
    // "allowSyntheticDefaultImports": true,             /* Allow 'import x from y' when a module doesn't have a default export. */
    "esModuleInterop": true,                             /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
    // "preserveSymlinks": true,                         /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
    "forceConsistentCasingInFileNames": true,            /* Ensure that casing is correct in imports. */

    /* Type Checking */
    "strict": true,                                      /* Enable all strict type-checking options. */
    // "noImplicitAny": true,                            /* Enable error reporting for expressions and declarations with an implied 'any' type. */
    // "strictNullChecks": true,                         /* When type checking, take into account 'null' and 'undefined'. */
    // "strictFunctionTypes": true,                      /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
    // "strictBindCallApply": true,                      /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
    // "strictPropertyInitialization": true,             /* Check for class properties that are declared but not set in the constructor. */
    // "noImplicitThis": true,                           /* Enable error reporting when 'this' is given the type 'any'. */
    // "useUnknownInCatchVariables": true,               /* Default catch clause variables as 'unknown' instead of 'any'. */
    // "alwaysStrict": true,                             /* Ensure 'use strict' is always emitted. */
    // "noUnusedLocals": true,                           /* Enable error reporting when local variables aren't read. */
    // "noUnusedParameters": true,                       /* Raise an error when a function parameter isn't read. */
    // "exactOptionalPropertyTypes": true,               /* Interpret optional property types as written, rather than adding 'undefined'. */
    // "noImplicitReturns": true,                        /* Enable error reporting for codepaths that do not explicitly return in a function. */
    // "noFallthroughCasesInSwitch": true,               /* Enable error reporting for fallthrough cases in switch statements. */
    // "noUncheckedIndexedAccess": true,                 /* Add 'undefined' to a type when accessed using an index. */
    // "noImplicitOverride": true,                       /* Ensure overriding members in derived classes are marked with an override modifier. */
    // "noPropertyAccessFromIndexSignature": true,       /* Enforces using indexed accessors for keys declared using an indexed type. */
    // "allowUnusedLabels": true,                        /* Disable error reporting for unused labels. */
    // "allowUnreachableCode": true,                     /* Disable error reporting for unreachable code. */

    /* Completeness */
    // "skipDefaultLibCheck": true,                      /* Skip type checking .d.ts files that are included with TypeScript. */
    "skipLibCheck": true                                 /* Skip type checking all .d.ts files. */
  }
}

翻译

{
  "compilerOptions": {
    /* 访问 https://aka.ms/tsconfig 以了解更多关于此文件的信息 */

    /* 项目 */
    // "incremental": true,                              /* 保存 .tsbuildinfo 文件以允许项目的增量编译。 */
    // "composite": true,                                /* 启用允许TypeScript项目与项目引用一起使用的约束。 */
    // "tsBuildInfoFile": "./.tsbuildinfo",              /* 指定 .tsbuildinfo 增量编译文件的路径。 */
    // "disableSourceOfProjectReferenceRedirect": true,  /* 禁用在引用复合项目时优先使用源文件而非声明文件。 */
    // "disableSolutionSearching": true,                 /* 在编辑时选择让项目退出多项目引用检查。 */
    // "disableReferencedProjectLoad": true,             /* 减少TypeScript自动加载的项目数量。 */

    /* 语言和环境 */
    "target": "es2016",                                  /* 设置生成的JavaScript的语言版本并包含兼容的库声明。 */
    // "lib": [],                                        /* 指定一组包含的库声明文件,描述目标运行时环境。 */
    // "jsx": "preserve",                                /* 指定生成的JSX代码。 */
    // "experimentalDecorators": true,                   /* 启用对旧版实验性装饰器的实验性支持。 */
    // "emitDecoratorMetadata": true,                    /* 在源文件中为装饰过的声明发出设计类型元数据。 */
    // "jsxFactory": "",                                 /* 指定用于针对React JSX发出目标时使用的JSX工厂函数,例如'React.createElement'或'h'。 */
    // "jsxFragmentFactory": "",                         /* 指定用于碎片的JSX片段引用,针对React JSX发出目标时使用,例如'React.Fragment'或'Fragment'。 */
    // "jsxImportSource": "",                            /* 指定在使用'jsx: react-jsx*'时用于导入JSX工厂函数的模块说明符。 */
    // "reactNamespace": "",                             /* 指定用于'createElement'的调用对象。这仅适用于目标为'react' JSX发出。 */
    // "noLib": true,                                    /* 禁用包括任何库文件,包括默认的lib.d.ts。 */
    // "useDefineForClassFields": true,                  /* 发出符合ECMAScript标准的类字段。 */
    // "moduleDetection": "auto",                        /* 控制检测模块格式JS文件使用的方法。 */

    /* 模块 */
    "module": "commonjs",                                /* 指定生成的模块代码。 */
    // "rootDir": "./",                                  /* 指定源文件的根文件夹。 */
    // "moduleResolution": "node10",                     /* 指定TypeScript如何从给定模块说明符查找文件。 */
    // "baseUrl": "./",                                  /* 指定用于解析非相对模块名称的基目录。 */
    // "paths": {},                                      /* 指定一组输入,将导入重新映射到额外的查找位置。 */
    // "rootDirs": [],                                   /* 允许在解析模块时将多个文件夹视为一个。 */
    // "typeRoots": [],                                  /* 指定行为类似'./node_modules/@types'的多个文件夹。 */
    // "types": [],                                      /* 指定要包含的类型包名称,无需在源文件中引用。 */
    // "allowUmdGlobalAccess": true,                     /* 允许从模块访问UMD全局变量。 */
    // "moduleSuffixes": [],                             /* 在解析模块时搜索的文件名后缀列表。 */
    // "allowImportingTsExtensions": true,               /* 允许导入包含TypeScript文件扩展名的导入。需要设置'--moduleResolution bundler'以及'--noEmit'或'--emitDeclarationOnly'。 */
    // "resolvePackageJsonExports": true,                /* 在解析包导入时使用package.json的'exports'字段。 */
    // "resolvePackageJsonImports": true,                /* 在解析导入时使用package.json的'imports'字段。 */
    // "customConditions": [],                           /* 在解析导入时设置解析器特定默认值以外的条件。 */
    // "resolveJsonModule": true,                        /* 启用导入.json文件。 */
    // "allowArbitraryExtensions": true,                 /* 允许导入任意扩展名的文件,前提是存在声明文件。 */
    // "noResolve": true,                                /* 禁止'import'、'require'或'<reference>'扩展TypeScript应添加到项目的文件数量。 */

    /* JavaScript 支持 */
    // "allowJs": true,                                  /* 允许JavaScript文件成为程序的一部分。使用'checkJS'选项从这些文件中获取错误。 */
    // "checkJs": true,                                  /* 在受类型检查的JavaScript文件中启用错误报告。 */
    // "maxNodeModuleJsDepth": 1,                        /* 指定用于检查来自'node_modules'的JavaScript文件的最大文件夹深度。仅与'allowJs'一起适用。 */

    /* 输出 */
    // "declaration": true,                              /* 从项目中的TypeScript和JavaScript文件生成.d.ts文件。 */
    // "declarationMap": true,                           /* 为d.ts文件创建源映射。 */
    // "emitDeclarationOnly": true,                      /* 仅输出d.ts文件而不输出JavaScript文件。 */
    // "sourceMap": true,                                /* 为生成的JavaScript文件创建源映射文件。 */
    // "inlineSourceMap": true,                          /* 在生成的JavaScript中包括源映射文件。 */
    // "outFile": "./",                                  /* 指定将所有输出捆绑到一个JavaScript文件中的文件。如果设置了'declaration',也指定一个捆绑所有.d.ts输出的文件。 */
    // "outDir": "./",                                   /* 指定所有生成文件的输出文件夹。 */
    // "removeComments": true,                           /* 禁用输出注释。 */
    // "noEmit": true,                                   /* 禁用从编译中输出文件。 */
    // "importHelpers": true,                            /* 允许从tslib中导入辅助函数一次性使用,而不是每个文件中都包含它们。 */
    // "importsNotUsedAsValues": "remove",               /* 指定仅用于类型的导入的发出/检查行为。 */
    // "downlevelIteration": true,                       /* 为迭代发出更符合标准,但更冗长和性能较差的JavaScript。 */
    // "sourceRoot": "",                                 /* 指定调试器查找引用源代码的根路径。 */
    // "mapRoot": "",                                    /* 指定调试器应该在哪里定位映射文件而不是生成的位置。 */
    // "inlineSources": true,                            /* 在生成的JavaScript中包含源码的源映射内。 */
    // "emitBOM": true,                                  /* 在输出文件开头发出UTF-8字节顺序标记(BOM)。 */
    // "newLine": "crlf",                                /* 设置发出文件的换行字符。 */
    // "stripInternal": true,                            /* 禁用发出带有'@internal'其JSDoc注释的声明。 */
    // "noEmitHelpers": true,                            /* 禁用在编译输出中生成自定义辅助函数如'__extends'。 */
    // "noEmitOnError": true,                            /* 如果报告了任何类型检查错误则禁用发出文件。 */
    // "preserveConstEnums": true,                       /* 在生成的代码中不删除'const enum'声明。 */
    // "declarationDir": "./",                           /* 指定生成声明文件的输出目录。 */
    // "preserveValueImports": true,                     /* 在JavaScript输出中保留可能会被移除的未使用的导入值。 */

    /* 互操作性限制 */
    // "isolatedModules": true,                          /* 确保每个文件可以安全地进行单独转译,而不依赖于其他导入。 */
    // "verbatimModuleSyntax": true,                     /* 不转换或省略任何未标记为仅类型的导入或导出,确保它们根据'module'设置写入输出文件的格式。 */
    // "allowSyntheticDefaultImports": true,             /* 当模块没有默认导出时,允许使用'import x from y'。 */
    "esModuleInterop": true,                             /* 生成附加的JavaScript以简化CommonJS模块的导入支持。这为类型兼容性启用了'allowSyntheticDefaultImports'。 */
    // "preserveSymlinks": true,                         /* 禁用将符号链接解析到它们的真实路径。这与node中的同名标志相关。 */
    "forceConsistentCasingInFileNames": true,            /* 确保导入中的大小写是正确的。 */

    /* 类型检查 */
    "strict": true,                                      /* 启用所有严格的类型检查选项。 */
    // "noImplicitAny": true,                            /* 对含有隐含'any'类型的表达式和声明启用错误报告。 */
    // "strictNullChecks": true,                         /* 在类型检查时考虑'null'和'undefined'。 */
    // "strictFunctionTypes": true,                      /* 在分配函数时检查确保参数和返回值是子类型兼容的。 */
    // "strictBindCallApply": true,                      /* 检查'bind'、'call'和'apply'方法的参数与原函数匹配。 */
    // "strictPropertyInitialization": true,             /* 检查在构造函数中未设置的声明但已声明的类属性。 */
    // "noImplicitThis": true,                           /* 当'this'表达式具有类型'any'时启用错误报告。 */
    // "useUnknownInCatchVariables": true,               /* 默认将catch子句的变量视为'unknown'而不是'any'。 */
    // "alwaysStrict": true,                             /* 确保始终发出'use strict'。 */
    // "noUnusedLocals": true,                           /* 启用未读取的本地变量的错误报告。 */
    // "noUnusedParameters": true,                       /* 当函数参数未被读取时,引发错误。 */
    // "exactOptionalPropertyTypes": true,               /* 按照书写的方式解释可选属性类型,而不是添加'undefined'。 */
    // "noImplicitReturns": true,                        /* 对函数中不显式返回的代码路径启用错误报告。 */
    // "noFallthroughCasesInSwitch": true,               /* 对switch语句中的贯穿情况启用错误报告。 */
    // "noUncheckedIndexedAccess": true,                 /* 添加'undefined'到使用索引访问时的类型。 */
    // "noImplicitOverride": true,                       /* 确保在派生类中覆盖的成员带有override修饰符。 */
    // "noPropertyAccessFromIndexSignature": true,       /* 强制使用索引访问键,这些键是使用索引类型声明的。 */
    // "allowUnusedLabels": true,                        /* 禁用未使用标签的错误报告。 */
    // "allowUnreachableCode": true,                     /* 禁用不可达代码的错误报告。 */

    /* 完整性 */
    // "skipDefaultLibCheck": true,                      /* 跳过检查TypeScript包含的.d.ts文件的类型检查。 */
    "skipLibCheck": true                                 /* 跳过所有.d.ts文件的类型检查。 */
  }
}
  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值