浏览代码

add ts source files and add prebuild script for typescript checks

mightyplow 5 年之前
父节点
当前提交
5de8c552bd
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 2 1
      package.json
  2. 5 1
      tsconfig.json

+ 2 - 1
package.json

@@ -6,7 +6,8 @@
   "scripts": {
     "clean": "rm -rf ./dist",
     "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx",
-    "prebuild": "npm run clean",
+    "tscheck": "tsc --noEmit",
+    "prebuild": "npm run clean && npm run tscheck",
     "build": "parcel build -d dist --public-url ./ ./src/index.html",
     "predev": "npm run clean",
     "dev": "parcel serve -d dist --public-url / ./src/index.html",

+ 5 - 1
tsconfig.json

@@ -62,5 +62,9 @@
 
     /* Advanced Options */
     "forceConsistentCasingInFileNames": true  /* Disallow inconsistently-cased references to the same file. */
-  }
+  },
+
+  "include": [
+    "src/**/*"
+  ]
 }