{"id":10086,"date":"2020-04-18T14:17:58","date_gmt":"2020-04-18T05:17:58","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=10086"},"modified":"2023-05-27T23:28:57","modified_gmt":"2023-05-27T14:28:57","slug":"%e3%80%90typescript%e3%80%91%e3%80%8ctsconfig-json%e3%80%8d%e3%81%a8%e3%81%af%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=10086","title":{"rendered":"\u3010TypeScript\u3011\u300ctsconfig.json\u300d\u3068\u306f\uff1f"},"content":{"rendered":"<h2>tsconfig.json\u3068\u306f\uff1f<\/h2>\n<p>TypeScript\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<h2>\u4f5c\u6210\u65b9\u6cd5<\/h2>\n<p>\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3067\u751f\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">npx tsc --init<\/pre>\n<h2>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6319\u52d5<\/h2>\n<p>tsc\u3068\u6253\u3064\u3060\u3051\u3067\u5168\u3066\u306etypescript\u30d5\u30a1\u30a4\u30eb\u304c\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u307e\u3059\u3002\uff08tsconfig.json\u304c\u306a\u3044\u5834\u5408\u306f\u4e00\u3064\u4e00\u3064\u3084\u308b\u3057\u304b\u306a\u304b\u3063\u305f\u3002\uff09<\/p>\n<h2>\u5185\u5bb9<\/h2>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306a\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u5404\u884c\u304c\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3059\u308b\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u5927\u90e8\u5206\u304c\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u308b\u884c\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30c1\u30a7\u30c3\u30af\u3059\u308b\u8a2d\u5b9a<\/strong><\/span>\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u3082\u3057\u30c1\u30a7\u30c3\u30af\u3092\u5916\u3057\u305f\u3044\u5834\u5408\u306f\u30b3\u30e1\u30f3\u30c4\u30a2\u30a6\u30c8\u3092\u5916\u3057\u3001false\u7b49\u306b\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">  \"compilerOptions\": {\r\n    \/* Basic Options *\/\r\n    \/\/ \"incremental\": true,                   \/* Enable incremental compilation *\/\r\n    \"target\": \"es5\",                          \/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. *\/\r\n    \"module\": \"commonjs\",                     \/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. *\/\r\n    \/\/ \"lib\": [],                             \/* Specify library files to be included in the compilation. *\/\r\n    \/\/ \"allowJs\": true,                       \/* Allow javascript files to be compiled. *\/\r\n    \/\/ \"checkJs\": true,                       \/* Report errors in .js files. *\/\r\n\u2025<\/pre>\n<h2>compilerOptions<\/h2>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u8a2d\u5b9a\u9805\u76ee<\/th>\n<th>\u5185\u5bb9<\/th>\n<th>\u30c7\u30d5\u30a9\u30eb\u30c8<\/th>\n<\/tr>\n<tr>\n<td>\n<div>\n<div>strictNullChecks<\/div>\n<\/div>\n<\/td>\n<td>\u5909\u6570\u306bNull\u304c\u4ee3\u5165\u3055\u308c\u305f\u3089\u30a8\u30e9\u30fc\u3068\u3057\u307e\u3059\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>target<\/td>\n<td>\u5909\u63db\u5f8c\u306ees\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/td>\n<td>es3<\/td>\n<\/tr>\n<tr>\n<td>lib<\/td>\n<td>TypeScript\u304c\u7528\u610f\u3057\u3066\u3044\u308b\u578b\u5b9a\u7fa9\u3092\u6307\u5b9a\u3057\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u305d\u308c\u3092\u8003\u616e\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/td>\n<td>target\u306b\u3088\u3063\u3066\u5909\u308f\u308b\u304c\u3001\u69d8\u3005\u306a\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\uff08*.d.ts)<\/p>\n<p>\u4f8b\uff1aES5\u3001DOM\u306a\u3069\u3002<\/td>\n<\/tr>\n<tr>\n<td>allowJs<\/td>\n<td>JavaScript\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u5bfe\u8c61\u306b\u542b\u3080<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>checkJs<\/td>\n<td>JS\u3082TS\u3068\u540c\u69d8\u306b\u30a8\u30e9\u30fc\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u304b\u3002allowJs\u3068\u4e00\u7dd2\u306b\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u3053\u308c\u5358\u4f53\u3067\u306f\u4f7f\u308f\u306a\u3044\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>jsx<\/td>\n<td>React\u3067\u4f7f\u3046\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\n<div>\n<div>declaration<\/div>\n<\/div>\n<\/td>\n<td>\u578b\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u3089\u308c\u308b\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\n<div>\n<div>declarationMap<\/div>\n<\/div>\n<\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>sourceMap<\/td>\n<td>JS\u3068TS\u306e\u67b6\u3051\u6a4b\u306e\u30de\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3002\u30d6\u30e9\u30a6\u30b6\u3067TypeScript\u30d5\u30a1\u30a4\u30eb\u3092\u898b\u305f\u3044\u5834\u5408\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002\u30d6\u30e9\u30a6\u30b6\u306e\u958b\u767a\u8005\u30c4\u30fc\u30eb\u306eSources\u3067ts\u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/td>\n<td>false<\/td>\n<\/tr>\n<tr>\n<td>outDir<\/td>\n<td>\u30b3\u30f3\u30d1\u30a4\u30eb\u5f8c\u306eJS\u306e\u51fa\u529b\u5148<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>rootDir<\/td>\n<td>\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u3068outDir\u306f\u968e\u5c64\u304c\u3061\u3083\u3093\u3068\u4f5c\u3089\u308c\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u6307\u5b9a\u3059\u308c\u3070\u968e\u5c64\u307e\u3067\u3061\u3083\u3093\u3068\u518d\u73fe\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>removeComments<\/td>\n<td>\u30b3\u30e1\u30f3\u30c8\u3092\u6d88\u3059\u304b\u3069\u3046\u304b\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>noEmit<\/td>\n<td>\u4f55\u3082\u51fa\u529b\u3057\u306a\u3044\u3002TS\u306e\u30b3\u30fc\u30c9\u304c\u3061\u3083\u3093\u3068\u66f8\u3051\u3066\u3044\u308b\u304b\u306e\u30a8\u30e9\u30fc\u3060\u3051\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\n<div>\n<div>downlevelIteration<\/div>\n<\/div>\n<\/td>\n<td>\u30b3\u30fc\u30c9\u66f8\u3044\u3066for \u301c of\u304c\u52d5\u304b\u306a\u3044\u5834\u5408\u306b\u4f7f\u3046\u3002<\/td>\n<td>false<\/td>\n<\/tr>\n<tr>\n<td>noEmitOnError<\/td>\n<td>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306fJS\u30b3\u30fc\u30c9\u3092\u5909\u63db\u3057\u306a\u3044\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>strict<\/td>\n<td>7\u500b\u306e\u5225\u306e\u8a2d\u5b9a\u5024\u304c\u5168\u3066true\u306b\u306a\u308b\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\n<div>\n<div>noImplicitAny<\/div>\n<\/div>\n<\/td>\n<td>\u6697\u9ed9\u306eany\u306f\u907f\u3051\u3088\u3046\u3088\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\n<div>\n<div>noUnusedLocals<\/div>\n<\/div>\n<\/td>\n<td>\u4f7f\u3063\u3066\u306a\u3044\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u306f\u7981\u6b62\u3059\u308b\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\n<div>\n<div>noImplicitReturns<\/div>\n<\/div>\n<\/td>\n<td>return\u3092\u660e\u793a\u3057\u308d\u3002<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>include<\/h2>\n<p>\u30b3\u30f3\u30d1\u30a4\u30eb\u5bfe\u8c61\u3092\u7d5e\u308c\u307e\u3059\u3002<\/p>\n<h2>exclude<\/h2>\n<p>\u7279\u5b9a\u306etypescript\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u5bfe\u8c61\u304b\u3089\u9664\u304d\u305f\u3044\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002\u306a\u304a\u3001include\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u3082\u306e\u3092exclude\u3057\u305f\u5834\u5408\u306f\u3053\u3061\u3089\u304c\u512a\u5148\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6319\u52d5<\/h3>\n<p>\u4f55\u3082exclude\u3092\u8a18\u8ff0\u3057\u306a\u3044\u5834\u5408\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4ee5\u4e0b\u306e\u30d5\u30a9\u30eb\u30c0\u306f\u306e\u305e\u3044\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">node_modules<\/pre>\n<p>\u305f\u3060\u3001\u660e\u793a\u7684\u306bexclude\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306fnode_modules\u3082\u6307\u5b9a\u3057\u306a\u3044\u3068\u3060\u3081\u3067\u3059\u3002\u4e0a\u66f8\u304d\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9<\/h3>\n<pre class=\"lang:default decode:true\">*.spec.ts \/\/ \u7279\u5b9a\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u3064\u3044\u3066\u3044\u308b\u3082\u306e\u3060\u3051\u3002\r\n**\/index.ts \/\/\u7279\u5b9a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3060\u3051\r\n<\/pre>\n<h2>files<\/h2>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u307f\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"lang:default decode:true  \">src\/index.ts<\/pre>\n","protected":false},"excerpt":{"rendered":"tsconfig.json\u3068\u306f\uff1f TypeScript\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002 \u4f5c\u6210\u65b9\u6cd5 \u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3067\u751f\u6210\u3067\u304d\u307e\u3059\u3002 npx tsc --init \u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6319\u52d5 tsc\u3068\u6253\u3064\u3060\u3051\u3067\u5168\u3066\u306etypescr [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[101],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/10086"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10086"}],"version-history":[{"count":8,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/10086\/revisions"}],"predecessor-version":[{"id":20609,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/10086\/revisions\/20609"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10086"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}