{"id":99413,"date":"2026-09-02T15:04:53","date_gmt":"2026-09-02T07:04:53","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/99413.html"},"modified":"2026-09-02T15:04:53","modified_gmt":"2026-09-02T07:04:53","slug":"%e9%85%8d%e7%bd%ae-tsconfig-json%ef%bc%9a%e9%ab%98%e7%ba%a7%e9%80%89%e9%a1%b9","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/99413.html","title":{"rendered":"\u914d\u7f6e tsconfig.json\uff1a\u9ad8\u7ea7\u9009\u9879"},"content":{"rendered":"<h2>\u914d\u7f6e tsconfig.json&#xff1a;\u9ad8\u7ea7\u9009\u9879<\/h2>\n<p>\u6b22\u8fce\u7ee7\u7eed\u672c\u4e13\u680f\u7684\u7b2c\u4e09\u5341\u56db\u7bc7\u6587\u7ae0\u3002\u5728\u524d\u51e0\u671f\u4e2d&#xff0c;\u6211\u4eec\u5df2\u9010\u6b65\u63a2\u8ba8\u4e86 TypeScript \u7684\u5f02\u6b65\u7f16\u7a0b\u7279\u6027&#xff0c;\u5305\u62ec Promise \u7684\u7c7b\u578b\u652f\u6301\u3001\u6cdb\u578b\u5e94\u7528&#xff0c;\u4ee5\u53ca async\/await \u5728\u9519\u8bef\u4f20\u64ad\u4e2d\u7684\u4f5c\u7528\u3002\u8fd9\u4e9b\u77e5\u8bc6\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u7ba1\u7406\u5f02\u6b65\u6d41\u548c\u5f02\u5e38\u5904\u7406\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u5c06\u8f6c\u5411 TypeScript \u9879\u76ee\u914d\u7f6e\u7684\u6838\u5fc3\u6587\u4ef6\u2014\u2014tsconfig.json&#xff0c;\u91cd\u70b9\u8be6\u7ec6\u89e3\u6790 compilerOptions \u4e2d\u7684\u5173\u952e\u8bbe\u7f6e&#xff0c;\u5982 strict \u6a21\u5f0f\u3001target \u548c module\u3002\u8fd9\u4e9b\u9009\u9879\u662f\u63a7\u5236\u7f16\u8bd1\u884c\u4e3a\u7684\u5f00\u5173&#xff0c;\u5b83\u4eec\u51b3\u5b9a\u4e86 TypeScript \u5982\u4f55\u8f6c\u6362\u4ee3\u7801\u3001\u68c0\u67e5\u7c7b\u578b\u548c\u751f\u6210\u8f93\u51fa\u3002\u6211\u4eec\u5c06\u4ece tsconfig.json \u7684\u57fa\u7840\u4f5c\u7528\u5165\u624b&#xff0c;\u9010\u6b65\u6df1\u5165\u5230\u9ad8\u7ea7\u9009\u9879\u7684\u914d\u7f6e\u7ec6\u8282&#xff0c;\u5e76\u901a\u8fc7\u5b9e\u9645\u793a\u4f8b\u5c55\u793a\u5982\u4f55\u4f18\u5316\u9879\u76ee\u8bbe\u7f6e&#xff0c;\u63d0\u5347\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u3002\u901a\u8fc7\u7531\u6d45\u5165\u6df1\u7684\u5206\u6790\u548c\u573a\u666f\u5e94\u7528&#xff0c;\u6211\u4eec\u65e8\u5728\u5e2e\u52a9\u60a8\u5168\u9762\u638c\u63e1 tsconfig.json \u7684\u7cbe\u9ad3&#xff0c;\u5e76\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u5e94\u7528\u8fd9\u4e9b\u914d\u7f6e\u7b56\u7565&#xff0c;\u6784\u5efa\u66f4\u53ef\u9760\u548c\u53ef\u6269\u5c55\u7684 TypeScript \u73af\u5883\u3002\u5185\u5bb9\u5c06\u4ece\u57fa\u672c\u7ed3\u6784\u5c55\u5f00\u5230\u590d\u6742\u4f18\u5316&#xff0c;\u786e\u4fdd\u60a8\u80fd\u4ece\u7b80\u5355\u8bbe\u7f6e\u8fc7\u6e21\u5230\u9ad8\u7ea7\u8c03\u4f18&#xff0c;\u5e76\u83b7\u5f97\u6df1\u523b\u7684\u5b9e\u8df5\u6307\u5bfc\u3002<\/p>\n<h3>\u7406\u89e3 tsconfig.json \u5728 TypeScript \u9879\u76ee\u4e2d\u7684\u5b9a\u4f4d<\/h3>\n<p>tsconfig.json \u662f TypeScript \u9879\u76ee\u7684\u914d\u7f6e\u6587\u4ef6&#xff0c;\u5b83\u5b9a\u4e49\u4e86\u7f16\u8bd1\u89c4\u5219\u3001\u6587\u4ef6\u5305\u542b\u548c\u6392\u9664&#xff0c;\u4ee5\u53ca\u5404\u79cd\u7f16\u8bd1\u9009\u9879\u3002\u4f5c\u4e3a\u4e00\u4e2a JSON \u6587\u4ef6&#xff0c;\u5b83\u4f4d\u4e8e\u9879\u76ee\u6839\u76ee\u5f55&#xff0c;tsc \u547d\u4ee4\u4f1a\u81ea\u52a8\u8bfb\u53d6\u5b83\u6765\u6307\u5bfc\u7f16\u8bd1\u8fc7\u7a0b\u3002\u6ca1\u6709 tsconfig.json&#xff0c;tsc \u9ed8\u8ba4\u4f7f\u7528\u5bbd\u677e\u8bbe\u7f6e&#xff1b;\u6709\u4e86\u5b83&#xff0c;\u60a8\u53ef\u4ee5\u7cbe\u7ec6\u63a7\u5236\u884c\u4e3a&#xff0c;\u8ba9\u9879\u76ee\u9002\u5e94\u4e0d\u540c\u73af\u5883&#xff0c;\u5982\u6d4f\u89c8\u5668\u3001Node.js \u6216\u7279\u5b9a ES \u7248\u672c\u3002<\/p>\n<p>tsconfig.json \u7684\u5b9a\u4f4d\u5728\u4e8e\u6865\u63a5\u5f00\u53d1\u8005\u610f\u56fe\u4e0e\u7f16\u8bd1\u5668\u6267\u884c&#xff1a;\u5b83\u4e0d\u4ec5\u6307\u5b9a\u8f93\u5165\u8f93\u51fa\u8def\u5f84&#xff0c;\u8fd8\u63a7\u5236\u7c7b\u578b\u68c0\u67e5\u4e25\u683c\u5ea6\u548c\u6a21\u5757\u89e3\u6790\u7b56\u7565\u3002\u8fd9\u8ba9 TypeScript \u9879\u76ee\u66f4\u4e00\u81f4&#xff0c;\u5c24\u5176\u5728\u56e2\u961f\u534f\u4f5c\u4e2d&#xff0c;\u907f\u514d\u4e86\u547d\u4ee4\u884c\u53c2\u6570\u7684\u6df7\u4e71\u3002\u6839\u636e TypeScript \u5b98\u65b9\u624b\u518c&#xff0c;\u5408\u7406\u914d\u7f6e tsconfig \u53ef\u4ee5\u5c06\u7f16\u8bd1\u9519\u8bef\u51cf\u5c11&#xff0c;\u5e76\u4f18\u5316\u8f93\u51fa\u5927\u5c0f\u548c\u517c\u5bb9\u6027\u3002\u5728\u5927\u578b\u9879\u76ee\u4e2d&#xff0c;\u5982 monorepo \u6216\u5e93\u5f00\u53d1&#xff0c;tsconfig \u8fd8\u652f\u6301\u7ee7\u627f&#xff08;extends&#xff09;&#xff0c;\u8ba9\u5b50\u9879\u76ee\u590d\u7528\u57fa\u914d\u7f6e\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u4ece\u9ad8\u7ea7\u9009\u9879\u5f00\u59cb\u63a2\u8ba8&#xff1f;\u56e0\u4e3a\u57fa\u7840\u8bbe\u7f6e\u5982 include\/exclude \u76f8\u5bf9\u7b80\u5355&#xff0c;\u800c compilerOptions \u4e2d\u7684\u9ad8\u7ea7\u9009\u9879\u5982 strict\u3001target \u548c module&#xff0c;\u76f4\u63a5\u5f71\u54cd\u4ee3\u7801\u7684\u5b89\u5168\u6027\u548c\u6027\u80fd\u3002\u6211\u4eec\u5c06\u5148\u6982\u8ff0 tsconfig \u7684\u6574\u4f53\u7ed3\u6784&#xff0c;\u7136\u540e\u6df1\u5165 compilerOptions&#xff0c;\u786e\u4fdd\u60a8\u80fd\u7406\u89e3\u5982\u4f55\u4ece\u9ed8\u8ba4\u914d\u7f6e\u9010\u6b65\u5b9a\u5236\u9ad8\u7ea7\u8bbe\u7f6e&#xff0c;\u540c\u65f6\u907f\u514d\u5e38\u89c1\u8bef\u533a\u3002<\/p>\n<p>tsconfig.json \u5728 TypeScript \u4e2d\u7684\u5386\u53f2\u6e90\u4e8e\u65e9\u671f\u7248\u672c\u7684\u7f16\u8bd1 flag \u6f14\u53d8&#xff0c;\u5e76\u5728 1.5&#043; \u7248\u672c\u6807\u51c6\u5316\u4e3a JSON \u6587\u4ef6\u3002\u8fd9\u8ba9\u5b83\u6210\u4e3a\u9879\u76ee\u7ba1\u7406\u7684\u6838\u5fc3&#xff0c;\u5728\u5de5\u5177\u5982 VS Code \u6216 Webpack \u4e2d\u65e0\u7f1d\u96c6\u6210\u3002<\/p>\n<h3>tsconfig.json \u7684\u57fa\u672c\u7ed3\u6784&#xff1a;\u4ece\u7b80\u5355\u914d\u7f6e\u5230\u9879\u76ee\u7ba1\u7406<\/h3>\n<p>tsconfig.json \u7684\u7ed3\u6784\u662f\u4e00\u4e2a JSON \u5bf9\u8c61&#xff0c;\u4e3b\u8981\u5305\u542b compilerOptions\u3001include\u3001exclude\u3001files \u548c extends \u7b49\u5b57\u6bb5\u3002\u7406\u89e3\u8fd9\u4e9b\u57fa\u7840&#xff0c;\u80fd\u4e3a\u9ad8\u7ea7\u9009\u9879\u6253\u4e0b\u57fa\u7840\u3002<\/p>\n<h4>tsconfig.json \u7684\u57fa\u672c\u5b57\u6bb5\u4e0e\u793a\u4f8b<\/h4>\n<p>\u4e00\u4e2a\u7b80\u5355 tsconfig.json&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;compilerOptions&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;target&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;es5&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;module&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;commonjs&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;outDir&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;.\/dist&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;rootDir&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;.\/src&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;strict&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;include&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;src\/**\/*.ts&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;exclude&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;node_modules&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;**\/*.spec.ts&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<ul>\n<li>\n<p>compilerOptions&#xff1a;\u6838\u5fc3\u5bf9\u8c61&#xff0c;\u5305\u542b\u6240\u6709\u7f16\u8bd1\u8bbe\u7f6e\u3002\u6211\u4eec\u5c06\u91cd\u70b9\u89e3\u6790\u3002<\/p>\n<\/li>\n<li>\n<p>include&#xff1a; glob \u6a21\u5f0f\u6307\u5b9a\u7f16\u8bd1\u6587\u4ef6&#xff0c;\u9ed8\u8ba4\u6240\u6709 .ts\/.tsx\u3002<\/p>\n<\/li>\n<li>\n<p>exclude&#xff1a;\u6392\u9664\u6587\u4ef6&#xff0c;\u5982 node_modules\u3002<\/p>\n<\/li>\n<li>\n<p>files&#xff1a;\u663e\u5f0f\u5217\u8868\u6587\u4ef6&#xff0c;\u4f18\u5148\u4e8e include\u3002<\/p>\n<\/li>\n<li>\n<p>extends&#xff1a;\u7ee7\u627f\u53e6\u4e00 tsconfig&#xff0c;\u5982 \u201c.\/base.json\u201d\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u57fa\u672c\u7ed3\u6784\u8ba9\u914d\u7f6e\u6613\u7ba1\u7406&#xff1a;\u5c0f\u9879\u76ee\u7b80\u5355 JSON&#xff0c;\u5927\u9879\u76ee\u7ee7\u627f\u57fa\u6587\u4ef6\u3002<\/p>\n<p>\u8fd0\u884c tsc &#8211;init \u751f\u6210\u6a21\u677f&#xff0c;\u5305\u542b\u6ce8\u91ca\u89e3\u91ca\u9009\u9879\u3002<\/p>\n<h4>tsconfig.json \u7684\u6df1\u5165\u7ba1\u7406<\/h4>\n<p>\u7ee7\u627f\u793a\u4f8b&#xff1a;<\/p>\n<p>base.json&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;compilerOptions&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;strict&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token string-property property\">&#034;target&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;esnext&#034;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>project tsconfig&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;extends&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;.\/base.json&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;compilerOptions&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token string-property property\">&#034;outDir&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;.\/dist&#034;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token string-property property\">&#034;include&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;src&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u7ee7\u627f\u5408\u5e76\u9009\u9879&#xff0c;\u5b50\u8986\u76d6\u7236\u3002<\/p>\n<p>\u5f15\u7528&#xff08;references&#xff09;&#xff1a;\u590d\u5408\u9879\u76ee&#xff0c;\u5982 monorepo\u3002<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;references&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span> <span class=\"token string-property property\">&#034;path&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;.\/lib&#034;<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span> <span class=\"token string-property property\">&#034;path&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;.\/app&#034;<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u6df1\u5165\u7ba1\u7406\u8ba9 tsconfig \u9002\u5e94\u590d\u6742\u7ed3\u6784&#xff0c;\u5728 CI\/CD \u4e2d\u6807\u51c6\u5316\u3002<\/p>\n<h3>compilerOptions \u7684\u6982\u8ff0&#xff1a;\u63a7\u5236\u7f16\u8bd1\u6838\u5fc3<\/h3>\n<p>compilerOptions \u662f tsconfig \u7684\u5fc3\u810f&#xff0c;\u5305\u542b 100&#043; \u9009\u9879&#xff0c;\u5206\u7c7b\u522b\u5982\u7c7b\u578b\u68c0\u67e5\u3001\u6a21\u5757\u3001\u8f93\u51fa\u548c\u6e90\u5730\u56fe\u3002\u6211\u4eec\u5c06\u91cd\u70b9\u89e3\u6790\u9ad8\u7ea7\u5173\u952e\u8bbe\u7f6e&#xff0c;\u4ece\u57fa\u7840\u5230\u6df1\u5165\u3002<\/p>\n<h4>compilerOptions \u7684\u57fa\u672c\u5206\u7c7b<\/h4>\n<li>\n<p>\u7c7b\u578b\u68c0\u67e5&#xff1a;\u5982 strict\u3001noImplicitAny\u3002<\/p>\n<\/li>\n<li>\n<p>\u6a21\u5757&#xff1a;module\u3001moduleResolution\u3002<\/p>\n<\/li>\n<li>\n<p>\u8f93\u51fa&#xff1a;target\u3001outDir\u3001declaration\u3002<\/p>\n<\/li>\n<li>\n<p>\u6e90\u5730\u56fe&#xff1a;sourceMap\u3001inlineSources\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u9a8c&#xff1a;experimentalDecorators\u3002<\/p>\n<\/li>\n<p>\u57fa\u672c\u5206\u7c7b\u5e2e\u52a9\u7ec4\u7ec7\u9009\u9879&#xff0c;\u63a8\u8350\u4ece strict \u5f00\u59cb\u542f\u7528\u3002<\/p>\n<h4>compilerOptions \u7684\u6df1\u5165\u5f71\u54cd<\/h4>\n<p>\u9009\u9879\u4ea4\u4e92&#xff1a;strict \u542f\u7528\u591a\u4e2a\u5b50\u9009\u9879&#xff0c;\u5982 noImplicitThis\u3002<\/p>\n<p>\u6027\u80fd&#xff1a;\u67d0\u4e9b\u5982 noUnusedLocals \u589e\u52a0\u68c0\u67e5\u65f6\u95f4&#xff0c;\u4f46\u63d0\u5347\u8d28\u91cf\u3002<\/p>\n<p>\u6df1\u5165\u7406\u89e3\u8ba9\u60a8\u4f18\u5316&#xff1a;\u5f00\u53d1\u7528 sourceMap true&#xff0c;\u751f\u4ea7 false\u3002<\/p>\n<h3>\u8be6\u7ec6\u89e3\u6790 strict \u6a21\u5f0f&#xff1a;\u63d0\u5347\u7c7b\u578b\u5b89\u5168<\/h3>\n<p>strict \u662f compilerOptions \u7684\u65d7\u8230\u9009\u9879&#xff0c;\u5b83\u542f\u7528\u4e00\u7ec4\u4e25\u683c\u68c0\u67e5\u5b50\u9009\u9879&#xff0c;\u786e\u4fdd\u4ee3\u7801\u6700\u5927\u7c7b\u578b\u5b89\u5168\u3002<\/p>\n<h4>strict \u6a21\u5f0f\u7684\u57fansk \u672c\u542f\u7528\u4e0e\u4f5c\u7528<\/h4>\n<p>\u542f\u7528&#xff1a;\u201cstrict\u201d: true\u3002<\/p>\n<p>\u4f5c\u7528&#xff1a;\u6fc0\u6d3b noImplicitAny\u3001strictNullChecks \u7b49&#xff0c;\u9632\u6b62\u9690\u5f0f any \u6216 null \u9519\u8bef\u3002<\/p>\n<p>\u793a\u4f8b\u65e0 strict&#xff1a;<\/p>\n<p><span class=\"token keyword\">function<\/span> <span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span>value<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>  <span class=\"token comment\">\/\/ value any<\/span><br \/>\n  <span class=\"token builtin\">console<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span>value<span class=\"token punctuation\">.<\/span>length<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u8fd0\u884c\u65f6\u53ef\u80fd\u9519<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u6709 strict&#xff1a;<\/p>\n<p>\/\/ \u9519\u8bef&#xff1a;value \u9690\u5f0f any<\/p>\n<p>\u57fa\u672c&#xff1a;strict \u5f3a\u5236\u663e\u5f0f\u7c7b\u578b&#xff0c;\u51cf\u5c11\u8fd0\u884c\u65f6\u60ca\u559c\u3002<\/p>\n<h4>strict \u6a21\u5f0f\u7684\u6df1\u5165\u5b50\u9009\u9879<\/h4>\n<p>strict \u5305\u62ec&#xff1a;<\/p>\n<li>noImplicitAny&#xff1a;\u7981\u6b62\u9690\u5f0f any\u3002<\/li>\n<p><span class=\"token keyword\">let<\/span> implicit<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u9519\u8bef<\/span><br \/>\n<span class=\"token keyword\">let<\/span> explicit<span class=\"token operator\">:<\/span> <span class=\"token builtin\">any<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<li>strictNullChecks&#xff1a;null\/undefined \u975e any \u5b50\u7c7b\u578b\u3002<\/li>\n<p><span class=\"token keyword\">let<\/span> str<span class=\"token operator\">:<\/span> <span class=\"token builtin\">string<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u9519\u8bef<\/span><br \/>\n<span class=\"token keyword\">let<\/span> maybeStr<span class=\"token operator\">:<\/span> <span class=\"token builtin\">string<\/span> <span class=\"token operator\">|<\/span> <span class=\"token keyword\">null<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u6709\u6548<\/span><\/p>\n<p>\u9700\u5b88\u536b&#xff1a;<\/p>\n<p><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>maybeStr <span class=\"token operator\">!&#061;&#061;<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token builtin\">console<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span>maybeStr<span class=\"token punctuation\">.<\/span>length<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<li>\n<p>strictFunctionTypes&#xff1a;\u51fd\u6570\u7c7b\u578b\u9006\u53d8\u68c0\u67e5\u3002<\/p>\n<\/li>\n<li>\n<p>strictBindCallApply&#xff1a;bind\/call\/apply \u53c2\u6570\u68c0\u67e5\u3002<\/p>\n<\/li>\n<li>\n<p>strictPropertyInitialization&#xff1a;\u7c7b\u5c5e\u6027\u521d\u59cb\u5316\u68c0\u67e5\u3002<\/p>\n<\/li>\n<p><span class=\"token keyword\">class<\/span> <span class=\"token class-name\"><span class=\"token constant\">C<\/span><\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  prop<span class=\"token operator\">:<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u9519\u8bef&#xff0c;\u672a\u521d\u59cb\u5316<\/span><br \/>\n  <span class=\"token function\">constructor<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">this<\/span><span class=\"token punctuation\">.<\/span>prop <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;init&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<li>\n<p>noImplicitThis&#xff1a;this \u975e any\u3002<\/p>\n<\/li>\n<li>\n<p>alwaysStrict&#xff1a;\u8f93\u51fa \u201cuse strict\u201d\u3002<\/p>\n<\/li>\n<p>\u6df1\u5165\u5b50\u9009\u9879\u8ba9 strict \u5168\u9762&#xff0c;\u63a8\u8350\u65b0\u9879\u76ee\u542f\u7528&#xff0c;\u65e7\u9879\u76ee\u6e10\u8fdb\u3002<\/p>\n<p>\u81ea\u5b9a\u4e49&#xff1a;\u5355\u72ec\u542f\u7528\u5b50\u9009\u9879&#xff0c;\u5982\u53ea \u201cstrictNullChecks\u201d: true\u3002<\/p>\n<h3>\u8be6\u7ec6\u89e3\u6790 target&#xff1a;\u63a7\u5236\u8f93\u51fa JavaScript \u7248\u672c<\/h3>\n<p>target \u6307\u5b9a\u7f16\u8bd1\u76ee\u6807 ES \u7248\u672c&#xff0c;\u5982 \u201ces3\u201d\u3001\u201ces5\u201d\u3001\u201ces2015\u201d\u3001\u201cesnext\u201d\u3002<\/p>\n<h4>target \u7684\u57fa\u672c\u914d\u7f6e\u4e0e\u5f71\u54cd<\/h4>\n<p>\u9ed8\u8ba4 \u201ces3\u201d&#xff0c;\u517c\u5bb9\u65e7\u73af\u5883\u3002<\/p>\n<p>\u914d\u7f6e \u201ctarget\u201d: \u201ces2015\u201d&#xff0c;\u4fdd\u7559\u73b0\u4ee3\u8bed\u6cd5\u5982 class\u3001arrow\u3002<\/p>\n<p>\u793a\u4f8b ES5 target \u5c06 let\/const \u8f6c\u4e3a var&#xff0c;class \u8f6c\u4e3a\u51fd\u6570\u3002<\/p>\n<p>\u57fa\u672c&#xff1a;target \u51b3\u5b9a\u8f93\u51fa\u517c\u5bb9\u6027&#xff0c;\u6d4f\u89c8\u5668\u7528 \u201ces5\u201d&#xff0c;Node \u7528 \u201cesnext\u201d\u3002<\/p>\n<h4>target \u7684\u6df1\u5165\u6548\u679c<\/h4>\n<p>target \u5f71\u54cd&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u8bed\u6cd5\u4e0b\u8f6c\u6362&#xff1a;async\/await \u5728 \u201ces5\u201d \u7528 generator\u3002<\/p>\n<\/li>\n<li>\n<p>\u5185\u7f6e\u7c7b\u578b&#xff1a;\u9ad8 target \u5305\u62ec BigInt \u7b49\u3002<\/p>\n<\/li>\n<li>\n<p>\u6027\u80fd&#xff1a;\u4f4e target \u8f93\u51fa\u66f4\u591a\u4ee3\u7801\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u6df1\u5165&#xff1a;\u4e0e lib \u7ed3\u5408&#xff0c;lib \u6307\u5b9a\u53ef\u7528 API \u5982 \u201ces2018\u201d\u3002<\/p>\n<p><span class=\"token string-property property\">&#034;lib&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;es2018&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;dom&#034;<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>lib \u201cdom\u201d \u6dfb\u52a0 window\u3001document \u7c7b\u578b\u3002<\/p>\n<p>\u6df1\u5165\u6548\u679c\u8ba9 target \u9002\u5e94\u76ee\u6807\u5e73\u53f0&#xff0c;\u5728 Webpack\/Babel \u4e2d\u4e0e loader \u534f\u8c03\u3002<\/p>\n<p>\u5e38\u89c1&#xff1a;\u6d4f\u89c8\u5668 \u201ces5\u201d&#xff0c;\u670d\u52a1\u5668 \u201ces2020\u201d\u3002<\/p>\n<h3>\u8be6\u7ec6\u89e3\u6790 module&#xff1a;\u7ba1\u7406\u6a21\u5757\u7cfb\u7edf<\/h3>\n<p>module \u6307\u5b9a\u8f93\u51fa\u6a21\u5757\u683c\u5f0f&#xff0c;\u5982 \u201ccommonjs\u201d\u3001\u201camd\u201d\u3001\u201ces2015\u201d\u3001\u201csystem\u201d\u3001\u201cnone\u201d\u3002<\/p>\n<h4>module \u7684\u57fa\u672c\u914d\u7f6e\u4e0e\u4f5c\u7528<\/h4>\n<p>\u201cmodule\u201d: \u201ccommonjs\u201d \u8f93\u51fa require\/module.exports&#xff0c;Node \u9ed8\u8ba4\u3002<\/p>\n<p>\u201ces2015\u201d \u8f93\u51fa import\/export&#xff0c;\u73b0\u4ee3\u6d4f\u89c8\u5668\u3002<\/p>\n<p>\u793a\u4f8b commonjs&#xff1a;<\/p>\n<p>TS&#xff1a;<\/p>\n<p><span class=\"token keyword\">export<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token function\">func<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span><\/p>\n<p>JS&#xff1a;<\/p>\n<p>exports<span class=\"token punctuation\">.<\/span><span class=\"token function-variable function\">func<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u57fa\u672c&#xff1a;module \u51b3\u5b9a bundler \u5982\u4f55\u5904\u7406&#xff0c;\u5982 Webpack \u7528 \u201cesnext\u201d\u3002<\/p>\n<h4>module \u7684\u6df1\u5165\u9009\u9879<\/h4>\n<p>moduleResolution&#xff1a;\u4e0e module \u76f8\u5173&#xff0c;\u201cnode\u201d \u6216 \u201cclassic\u201d\u3002<\/p>\n<p>\u201cnode\u201d \u6a21\u62df Node \u89e3\u6790&#xff0c;\u63a8\u8350\u3002<\/p>\n<p>esModuleInterop&#xff1a;\u542f\u7528 \u201ccommonjs\u201d \u4e0e ES \u4e92\u64cd\u4f5c\u3002<\/p>\n<p><span class=\"token string-property property\">&#034;esModuleInterop&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span><\/p>\n<p>\u5141\u8bb8 import \u9ed8\u8ba4 from require \u6a21\u5757\u3002<\/p>\n<p>paths\/baseUrl&#xff1a;\u6a21\u5757\u522b\u540d\u3002<\/p>\n<p><span class=\"token string-property property\">&#034;baseUrl&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;.\/src&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token string-property property\">&#034;paths&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;&#064;utils\/*&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;utils\/*&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>import { func } from \u201c&#064;utils\/helper\u201d; \u89e3\u6790\u5230 src\/utils\/helper\u3002<\/p>\n<p>\u6df1\u5165\u9009\u9879\u8ba9 module \u9002\u5e94\u6784\u5efa\u5de5\u5177&#xff0c;\u5728 monorepo \u4e2d\u8def\u5f84\u6620\u5c04\u7b80\u5316\u5bfc\u5165\u3002<\/p>\n<h3>\u5176\u4ed6\u9ad8\u7ea7\u9009\u9879&#xff1a;\u5168\u9762\u4f18\u5316\u7f16\u8bd1<\/h3>\n<p>\u9664\u4e86 strict\u3001target\u3001module&#xff0c;\u8fd8\u6709\u5173\u952e\u9ad8\u7ea7\u9009\u9879\u3002<\/p>\n<h4>\u6e90\u5730\u56fe\u4e0e\u8c03\u8bd5\u9009\u9879<\/h4>\n<p>\u201csourceMap\u201d: true \u751f\u6210 .map \u6587\u4ef6&#xff0c;\u8c03\u8bd5\u65f6\u6620\u5c04 TS\u3002<\/p>\n<p>\u201cinlineSourceMap\u201d: true \u5185\u8054 map \u5230 JS\u3002<\/p>\n<p>\u201cinlineSources\u201d: true \u5185\u8054\u6e90\u4ee3\u7801\u5230 map\u3002<\/p>\n<p>\u8fd9\u4e9b\u5728\u5f00\u53d1\u5fc5\u5907&#xff0c;\u751f\u4ea7\u7981\u7528\u51cf\u5c0f\u5927\u5c0f\u3002<\/p>\n<h4>\u8f93\u51fa\u63a7\u5236\u9009\u9879<\/h4>\n<p>\u201coutDir\u201d: \u201c.\/dist\u201d \u8f93\u51fa\u76ee\u5f55\u3002<\/p>\n<p>\u201crootDir\u201d: \u201c.\/src\u201d \u6e90\u6839&#xff0c;\u4fdd\u6301\u7ed3\u6784\u3002<\/p>\n<p>\u201cdeclaration\u201d: true \u751f\u6210 .d.ts \u7c7b\u578b\u6587\u4ef6\u3002<\/p>\n<p>\u201cemitDeclarationOnly\u201d: true \u4ec5\u7c7b\u578b&#xff0c;\u65e0 JS\u3002<\/p>\n<p>\u7528\u4e8e\u5e93\u53d1\u5e03\u3002<\/p>\n<p>\u201cnoEmit\u201d: true \u4ec5\u68c0\u67e5&#xff0c;\u4e0d\u8f93\u51fa\u3002<\/p>\n<h4>\u7c7b\u578b\u68c0\u67e5\u9ad8\u7ea7<\/h4>\n<p>\u201cnoUnusedLocals\u201d: true \u62a5\u544a\u672a\u7528\u5c40\u90e8\u53d8\u91cf\u3002<\/p>\n<p>\u201cnoUnusedParameters\u201d: true \u672a\u7528\u53c2\u6570\u3002<\/p>\n<p>\u201cnoImplicitReturns\u201d: true \u51fd\u6570\u5fc5\u987b\u8fd4\u56de\u3002<\/p>\n<p>\u201cnoFallthroughCasesInSwitch\u201d: true switch \u9632 fallthrough\u3002<\/p>\n<p>\u8fd9\u4e9b\u4e0e strict \u8865\u5145&#xff0c;\u63d0\u5347\u8d28\u91cf\u3002<\/p>\n<h4>\u5b9e\u9a8c\u4e0e\u517c\u5bb9\u9009\u9879<\/h4>\n<p>\u201cexperimentalDecorators\u201d: true \u542f\u7528\u88c5\u9970\u5668\u3002<\/p>\n<p>\u201cdownlevelIteration\u201d: true ES5 \u8fed\u4ee3 polyfill\u3002<\/p>\n<p>\u201callowSyntheticDefaultImports\u201d: true \u5408\u6210\u9ed8\u8ba4\u5bfc\u5165\u3002<\/p>\n<p>\u9ad8\u7ea7\u9009\u9879\u5168\u9762&#xff0c;\u8ba9 tsconfig \u5b9a\u5236\u5316\u3002<\/p>\n<h3>\u914d\u7f6e tsconfig.json \u7684\u5b9e\u9645\u7b56\u7565<\/h3>\n<p>\u5c0f\u9879\u76ee\u7b80\u5355 tsconfig\u3002<\/p>\n<p>\u5927\u9879\u76ee\u5206\u5c42\u7ee7\u627f\u3002<\/p>\n<p>\u8c03\u8bd5&#xff1a;tsc &#8211;traceResolution \u8ddf\u8e2a\u89e3\u6790\u3002<\/p>\n<p>\u7b56\u7565\u4f18\u5316\u9879\u76ee\u3002<\/p>\n<h3>\u98ce\u9669\u4e0e\u6700\u4f73\u5b9e\u8df5<\/h3>\n<p>\u98ce\u9669&#xff1a;<\/p>\n<ul>\n<li>strict \u592a\u4e25\u963b\u8fc1\u79fb\u3002<\/li>\n<li>\u4f4e target \u5927\u8f93\u51fa\u3002<\/li>\n<li>\u9519 module \u6784\u5efa\u5931\u8d25\u3002<\/li>\n<\/ul>\n<p>\u5b9e\u8df5&#xff1a;<\/p>\n<ul>\n<li>\u6e10\u8fdb strict\u3002<\/li>\n<li>\u5339\u914d runtime target\u3002<\/li>\n<li>\u6d4b\u8bd5\u914d\u7f6e\u53d8\u66f4\u3002<\/li>\n<li>\u7248\u672c\u63a7\u5236 tsconfig\u3002<\/li>\n<\/ul>\n<p>\u786e\u4fdd\u6709\u6548\u3002<\/p>\n<h3>\u6848\u4f8b\u7814\u7a76&#xff1a;\u771f\u5b9e\u9879\u76ee<\/h3>\n<p>VS Code tsconfig \u591a\u73af\u5883\u3002<\/p>\n<p>Angular \u9ed8\u8ba4 strict\u3002<\/p>\n<p>\u4f18\u5316\u7f16\u8bd1 15%\u3002<\/p>\n<h3>\u7ed3\u8bed&#xff1a;tsconfig&#xff0c;TS \u9879\u76ee\u7684\u6307\u6325\u68d2<\/h3>\n<p>\u901a\u8fc7\u672c\u7bc7\u6587\u7ae0\u7684\u8be6\u5c3d\u63a2\u8ba8&#xff0c;\u60a8\u5df2\u638c\u63e1 tsconfig \u9ad8\u7ea7\u9009\u9879&#xff0c;\u4ece strict \u5230 module\u3002\u8fd9\u4e9b\u5c06\u52a9\u60a8\u4f18\u5316\u9879\u76ee\u3002\u5b9e\u8df5&#xff1a;\u8c03\u6574 tsconfig\u3002\u4e0b\u4e00\u671f\u6784\u5efa\u5de5\u5177\u96c6\u6210&#xff0c;\u656c\u8bf7\u671f\u5f85\u3002\u82e5\u7591\u95ee&#xff0c;\u6b22\u8fce\u4ea4\u6d41\u3002\u6211\u4eec\u7ee7\u7eed\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u7f6e tsconfig.json&#xff1a;\u9ad8\u7ea7\u9009\u9879<br \/>\n\u6b22\u8fce\u7ee7\u7eed\u672c\u4e13\u680f\u7684\u7b2c\u4e09\u5341\u56db\u7bc7\u6587\u7ae0\u3002\u5728\u524d\u51e0\u671f\u4e2d&#xff0c;\u6211\u4eec\u5df2\u9010\u6b65\u63a2\u8ba8\u4e86 TypeScript \u7684\u5f02\u6b65\u7f16\u7a0b\u7279\u6027&#xff0c;\u5305\u62ec Promise \u7684\u7c7b\u578b\u652f\u6301\u3001\u6cdb\u578b\u5e94\u7528&#xff0c;\u4ee5\u53ca async\/await \u5728\u9519\u8bef\u4f20\u64ad\u4e2d\u7684\u4f5c\u7528\u3002\u8fd9\u4e9b\u77e5\u8bc6\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u7ba1\u7406\u5f02\u6b65\u6d41\u548c\u5f02\u5e38\u5904\u7406\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u5c06\u8f6c\u5411 TypeScript \u9879\u76ee\u914d\u7f6e\u7684\u6838\u5fc3\u6587\u4ef6\u2014\u2014tsconfig.json&#xff0c;\u91cd\u70b9\u8be6\u7ec6\u89e3\u6790 compi<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[93,58,568,103,87],"topic":[],"class_list":["post-99413","post","type-post","status-publish","format-standard","hentry","category-server","tag-json","tag-linux","tag-typescript","tag-ubuntu","tag-87"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u914d\u7f6e tsconfig.json\uff1a\u9ad8\u7ea7\u9009\u9879 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/99413.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u914d\u7f6e tsconfig.json\uff1a\u9ad8\u7ea7\u9009\u9879 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u914d\u7f6e tsconfig.json&#xff1a;\u9ad8\u7ea7\u9009\u9879 \u6b22\u8fce\u7ee7\u7eed\u672c\u4e13\u680f\u7684\u7b2c\u4e09\u5341\u56db\u7bc7\u6587\u7ae0\u3002\u5728\u524d\u51e0\u671f\u4e2d&#xff0c;\u6211\u4eec\u5df2\u9010\u6b65\u63a2\u8ba8\u4e86 TypeScript \u7684\u5f02\u6b65\u7f16\u7a0b\u7279\u6027&#xff0c;\u5305\u62ec Promise \u7684\u7c7b\u578b\u652f\u6301\u3001\u6cdb\u578b\u5e94\u7528&#xff0c;\u4ee5\u53ca async\/await \u5728\u9519\u8bef\u4f20\u64ad\u4e2d\u7684\u4f5c\u7528\u3002\u8fd9\u4e9b\u77e5\u8bc6\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u7ba1\u7406\u5f02\u6b65\u6d41\u548c\u5f02\u5e38\u5904\u7406\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u5c06\u8f6c\u5411 TypeScript \u9879\u76ee\u914d\u7f6e\u7684\u6838\u5fc3\u6587\u4ef6\u2014\u2014tsconfig.json&#xff0c;\u91cd\u70b9\u8be6\u7ec6\u89e3\u6790 compi\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/99413.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-02T07:04:53+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99413.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/99413.html\",\"name\":\"\u914d\u7f6e tsconfig.json\uff1a\u9ad8\u7ea7\u9009\u9879 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-02T07:04:53+00:00\",\"dateModified\":\"2026-09-02T07:04:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/99413.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/99413.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99413.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u914d\u7f6e tsconfig.json\uff1a\u9ad8\u7ea7\u9009\u9879\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u914d\u7f6e tsconfig.json\uff1a\u9ad8\u7ea7\u9009\u9879 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/99413.html","og_locale":"zh_CN","og_type":"article","og_title":"\u914d\u7f6e tsconfig.json\uff1a\u9ad8\u7ea7\u9009\u9879 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u914d\u7f6e tsconfig.json&#xff1a;\u9ad8\u7ea7\u9009\u9879 \u6b22\u8fce\u7ee7\u7eed\u672c\u4e13\u680f\u7684\u7b2c\u4e09\u5341\u56db\u7bc7\u6587\u7ae0\u3002\u5728\u524d\u51e0\u671f\u4e2d&#xff0c;\u6211\u4eec\u5df2\u9010\u6b65\u63a2\u8ba8\u4e86 TypeScript \u7684\u5f02\u6b65\u7f16\u7a0b\u7279\u6027&#xff0c;\u5305\u62ec Promise \u7684\u7c7b\u578b\u652f\u6301\u3001\u6cdb\u578b\u5e94\u7528&#xff0c;\u4ee5\u53ca async\/await \u5728\u9519\u8bef\u4f20\u64ad\u4e2d\u7684\u4f5c\u7528\u3002\u8fd9\u4e9b\u77e5\u8bc6\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u7ba1\u7406\u5f02\u6b65\u6d41\u548c\u5f02\u5e38\u5904\u7406\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u5c06\u8f6c\u5411 TypeScript \u9879\u76ee\u914d\u7f6e\u7684\u6838\u5fc3\u6587\u4ef6\u2014\u2014tsconfig.json&#xff0c;\u91cd\u70b9\u8be6\u7ec6\u89e3\u6790 compi","og_url":"https:\/\/www.wsisp.com\/helps\/99413.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-02T07:04:53+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/99413.html","url":"https:\/\/www.wsisp.com\/helps\/99413.html","name":"\u914d\u7f6e tsconfig.json\uff1a\u9ad8\u7ea7\u9009\u9879 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-02T07:04:53+00:00","dateModified":"2026-09-02T07:04:53+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/99413.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/99413.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/99413.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u914d\u7f6e tsconfig.json\uff1a\u9ad8\u7ea7\u9009\u9879"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=99413"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99413\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=99413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=99413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=99413"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=99413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}