Browse Source

fix(tsconfig): 启用严格类型检查以提升代码质量

yz 2 weeks ago
parent
commit
c5dfe91d1b
1 changed files with 9 additions and 5 deletions
  1. 9 5
      tsconfig.json

+ 9 - 5
tsconfig.json

@@ -7,10 +7,11 @@
       "es6"
       "es6"
     ],
     ],
     "allowJs": true,
     "allowJs": true,
+    "checkJs": true,
     "skipLibCheck": true,
     "skipLibCheck": true,
     "esModuleInterop": true,
     "esModuleInterop": true,
     "allowSyntheticDefaultImports": true,
     "allowSyntheticDefaultImports": true,
-    "strict": false,
+    "strict": true,
     "forceConsistentCasingInFileNames": true,
     "forceConsistentCasingInFileNames": true,
     "module": "esnext",
     "module": "esnext",
     "moduleResolution": "node",
     "moduleResolution": "node",
@@ -48,10 +49,13 @@
     ],
     ],
     "experimentalDecorators": true,
     "experimentalDecorators": true,
     "emitDecoratorMetadata": true,
     "emitDecoratorMetadata": true,
-    "noImplicitAny": false,
-    "noImplicitReturns": false,
-    "noImplicitThis": false,
-    "strictNullChecks": false
+    "noImplicitAny": true,
+    "noImplicitReturns": true,
+    "noImplicitThis": true,
+    "strictNullChecks": true,
+    "strictPropertyInitialization": true,
+    "strictBindCallApply": true,
+    "strictFunctionTypes": true
   },
   },
   "include": [
   "include": [
     "src/**/*.ts",
     "src/**/*.ts",