Просмотр исходного кода

add strong typecheck to pre commit (#3945)

ianedwards 2 лет назад
Родитель
Сommit
ca722eae93

+ 8 - 8
dashboard/package-lock.json

@@ -152,7 +152,7 @@
         "terser-webpack-plugin": "^4.2.3",
         "ts-loader": "^8.0.4",
         "type-fest": "^4.3.1",
-        "typescript": "^4.1.2",
+        "typescript": "^5.2.2",
         "webpack": "^4.44.2",
         "webpack-bundle-analyzer": "^4.4.2",
         "webpack-cli": "^3.3.12",
@@ -16035,16 +16035,16 @@
       "dev": true
     },
     "node_modules/typescript": {
-      "version": "4.9.5",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
-      "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
+      "version": "5.2.2",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
+      "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
       "dev": true,
       "bin": {
         "tsc": "bin/tsc",
         "tsserver": "bin/tsserver"
       },
       "engines": {
-        "node": ">=4.2.0"
+        "node": ">=14.17"
       }
     },
     "node_modules/unbox-primitive": {
@@ -30347,9 +30347,9 @@
       "dev": true
     },
     "typescript": {
-      "version": "4.9.5",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
-      "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
+      "version": "5.2.2",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
+      "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
       "dev": true
     },
     "unbox-primitive": {

+ 3 - 3
dashboard/package.json

@@ -88,7 +88,7 @@
     "build": "NODE_ENV=\"production\" webpack",
     "build-and-analyze": "ENABLE_ANALYZER=true NODE_ENV=\"production\" ./node_modules/webpack/bin/webpack.js",
     "prepare": "cd .. && husky install dashboard/.husky",
-    "lint-staged": "lint-staged"
+    "lint-staged": "tsc --noEmit && lint-staged"
   },
   "devDependencies": {
     "@babel/core": "^7.15.0",
@@ -159,14 +159,14 @@
     "terser-webpack-plugin": "^4.2.3",
     "ts-loader": "^8.0.4",
     "type-fest": "^4.3.1",
-    "typescript": "^4.1.2",
+    "typescript": "^5.2.2",
     "webpack": "^4.44.2",
     "webpack-bundle-analyzer": "^4.4.2",
     "webpack-cli": "^3.3.12",
     "webpack-dev-server": "^3.11.0"
   },
   "lint-staged": {
-    "**/*.{js,ts,jsx,tsx}": [
+    "src/**/*.{js,ts,jsx,tsx}": [
       "eslint --fix",
       "prettier --write"
     ],

+ 0 - 1
dashboard/src/main/home/cluster-dashboard/env-groups/ExpandedEnvGroup.tsx

@@ -1072,7 +1072,6 @@ const EnvGroupSettings = ({
                   label="New env group namespace"
                   placeholder="ex: default"
                 />
-              )}
               <FlexAlt>
                 <Button onClick={cloneEnvGroup}>Clone {envGroup.name}</Button>
                 {cloneSuccess && (

+ 5 - 5
dashboard/tsconfig.json

@@ -1,8 +1,6 @@
 {
   "compilerOptions": {
-    "lib": [
-      "ESNext"
-    ],
+    "lib": ["ESNext"],
     "baseUrl": "src",
     "outDir": "./build/",
     "sourceMap": true,
@@ -15,5 +13,7 @@
     "removeComments": true,
     "moduleResolution": "node",
     "strict": true,
-  }
-}
+    "skipLibCheck": true
+  },
+  "exclude": ["node_modules", "build"]
+}