diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c2093e251..1c1e0ef97 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,10 +6,10 @@ "recommendations": [ "dbaeumer.vscode-eslint", "esbenp.prettier-vscode", - "octref.vetur", "hbenl.vscode-mocha-test-adapter", - "ryanluker.vscode-coverage-gutters" + "ryanluker.vscode-coverage-gutters", + "Vue.volar" ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. - "unwantedRecommendations": [] + "unwantedRecommendations": ["octref.vetur", "vscode.typescript-language-features"] } diff --git a/README.md b/README.md index fc27aed0e..e8f1080df 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

Speckle-Next - + codecov @@ -104,6 +104,13 @@ The suggested IDE for working in this repo is VSCode, because the repo has speci This repository relies on [VSCode multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces), so for the best DX and proper formatting/linting make sure you open the project using the `workspace.code-workspace` file instead of just opening the folder in VSCode. +#### Proper TypeScript support + +To get proper TS support in standard TS files as well as Vue files, we rely on the **Volar** VSCode extension - not **Vetur**! When you open the workspace for the very first time, VSCode should already prompt you to install this extension. +The default Volar setup can be quite resource intensive, however, because there end up being standard TS Language Server instances running as well as Vue TS Language server instances. To resolve this issue we rely on Volar's [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471). + +Essentially, ensure you have **Volar** enabled, and the built in **TypeScript and JavaScript Language Features** extension disabled (for this workspace)! + ### Useful containers #### Maildev diff --git a/packages/frontend/package.json b/packages/frontend/package.json index e8cb6853e..130c8986d 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -6,8 +6,7 @@ "serve": "ws -p 8080 -d dist -r '/([a-zA-Z0-9-_/]*)(\\?.*)? -> /app.html' ", "build": "vue-cli-service build --mode production --silent", "lint": "eslint . --ext .js,.ts,.vue,.tsx,.jsx", - "lint:vue": "vti diagnostics", - "lint:ts": "tsc --noEmit", + "lint:ts": "vue-tsc --noEmit", "build:dev": "vue-cli-service build --mode development --silent", "build:dev:profile": "yarn build:dev -- --profile", "build:profile": "yarn build -- --profile", @@ -102,8 +101,8 @@ "speed-measure-webpack-plugin": "^1.5.0", "type-fest": "^2.13.1", "typescript": "~4.1.5", - "vti": "^0.1.5", "vue-cli-plugin-vuetify": "^2.5.1", + "vue-tsc": "^0.40.13", "vuetify-loader": "^1.9.1", "webpack": "^4.46.0", "webpack-bundle-analyzer": "^4.5.0" diff --git a/packages/frontend/src/main/components/user/UserNotificationPreferences.vue b/packages/frontend/src/main/components/user/UserNotificationPreferences.vue index ede88e35e..a065d3bad 100644 --- a/packages/frontend/src/main/components/user/UserNotificationPreferences.vue +++ b/packages/frontend/src/main/components/user/UserNotificationPreferences.vue @@ -57,7 +57,7 @@ export default defineComponent({ mentionedInComment: 'Mentioned in comment', newStreamAccessRequest: 'Stream access request', streamAccessRequestApproved: 'Stream access request approved' - } + } as Record } }, computed: { diff --git a/packages/frontend/src/main/components/viewer/CanonicalViews.vue b/packages/frontend/src/main/components/viewer/CanonicalViews.vue index 5b04ccbec..166b7502a 100644 --- a/packages/frontend/src/main/components/viewer/CanonicalViews.vue +++ b/packages/frontend/src/main/components/viewer/CanonicalViews.vue @@ -30,6 +30,7 @@