Browse Source

chore(hd): 完善开发环境配置

- 推荐 Volar 与 uni-app 开发插件,禁用 Vetur 推荐
- 补充 hdApp 的路径别名和 Vue 2.7 静态检查范围
shizhongqi 1 day ago
parent
commit
76709aeb53
4 changed files with 54 additions and 0 deletions
  1. 10 0
      .vscode/extensions.json
  2. 3 0
      .vscode/settings.json
  3. 10 0
      hdApp/jsconfig.json
  4. 31 0
      hdApp/tsconfig.json

+ 10 - 0
.vscode/extensions.json

@@ -0,0 +1,10 @@
+{
+  "recommendations": [
+    "Vue.volar",
+    "simonhe.vscode-alias-jump",
+    "uni-helper.uni-helper-vscode"
+  ],
+  "unwantedRecommendations": [
+    "octref.vetur"
+  ]
+}

+ 3 - 0
.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+  "editor.gotoLocation.multipleDefinitions": "goto"
+}

+ 10 - 0
hdApp/jsconfig.json

@@ -0,0 +1,10 @@
+{
+  "compilerOptions": {
+    "paths": {
+      "@/*": ["./src/*"]
+    },
+    "jsx": "preserve",
+    "checkJs": false
+  },
+  "exclude": ["node_modules", "dist", "unpackage"]
+}

+ 31 - 0
hdApp/tsconfig.json

@@ -1,10 +1,41 @@
 {
   "compilerOptions": {
+    "target": "ESNext",
+    "module": "ESNext",
+    "moduleResolution": "bundler",
+    "allowJs": true,
+    "checkJs": false,
+    "noEmit": true,
+    "jsx": "preserve",
+    "paths": {
+      "@/*": [
+        "./src/*",
+        "./src/*.vue",
+        "./src/*/index.vue",
+        "./src/*/index.js"
+      ]
+    },
+    "lib": ["ESNext", "DOM"],
+    "skipLibCheck": true,
     "types": [
       "uni-app",
       "html5plus",
       "miniprogram-api-typings/types/lib.wx.api.d.ts",
       "mini-types/types/api"
     ]
+  },
+  "include": [
+    "src/**/*.js",
+    "src/**/*.ts",
+    "src/**/*.d.ts",
+    "src/**/*.vue"
+  ],
+  "exclude": [
+    "node_modules",
+    "dist",
+    "unpackage"
+  ],
+  "vueCompilerOptions": {
+    "target": 2.7
   }
 }