Skip to content

In SFC, a typescript type declaration at the bottom of the script block (non-setup) would break the syntax highlighting #5353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zlinst opened this issue May 7, 2025 · 0 comments
Labels
duplicate This issue or pull request already exists

Comments

@zlinst
Copy link

zlinst commented May 7, 2025

Vue - Official extension or vue-tsc version

2.2.10

VSCode version

1.99.3

Vue version

3.5.13

TypeScript version

5.8.3

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 9 8945HS w/ Radeon 780M Graphics
    Memory: 7.70 GB / 31.29 GB
  Binaries:
    Node: 22.14.0 - ~\scoop\apps\nvm\current\nodejs\nodejs\node.EXE
    npm: 10.9.2 - ~\scoop\apps\nvm\current\nodejs\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

package.json dependencies

{
  "dependencies": {
    "@nuxt/ui": "^3.1.1",
    "@pinia/nuxt": "^0.11.0",
    "@vueuse/components": "^13.1.0",
    "@vueuse/core": "^13.1.0",
    "dayjs": "^1.11.13",
    "lodash-es": "^4.17.21",
    "nuxt": "^3.17.1",
    "pinia": "^3.0.2",
    "vue": "^3.5.13",
    "vue-router": "^4.5.0",
    "zod": "^3.24.3"
  },
  "devDependencies": {
    "@iconify-json/lucide": "^1.2.36",
    "@nuxt/eslint": "^1.3.0",
    "@types/lodash-es": "^4.17.12",
    "@types/node": "^22.14.1",
    "eslint": "^9.24.0",
    "rumble-types": "github:superteem-tech/rumble-types#1.14.12-0",
    "typescript": "^5.8.3",
    "vue-tsc": "^2.2.8"
  },
  "optionalDependencies": {
    "@rollup/rollup-linux-x64-gnu": "4.40.0"
  }
}

Steps to reproduce

A typescript type declaration in the bottom of <script lang="ts"> block would cause the syntax highlighting not working.

e.g.

<script lang="ts">
export type SidebarMenuItem = {
  name: string
}
</script>

<template>
  <h1>Hello</h1>
</template>

Screenshot

Image

What is expected?

Syntax highlighting works as expected:

Image

What is actually happening?

Image

Link to minimal reproduction

No response

Any additional comments?

No response

@KazariEX KazariEX added duplicate This issue or pull request already exists and removed pending triage labels May 7, 2025
@KazariEX KazariEX closed this as completed May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants