Skip to content
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

Issue with Pug template v2.0.0 - never read warning #3930

Closed
juzser opened this issue Mar 2, 2024 · 7 comments
Closed

Issue with Pug template v2.0.0 - never read warning #3930

juzser opened this issue Mar 2, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@juzser
Copy link

juzser commented Mar 2, 2024

Seem likes the new version has not been compatible with template using pug yet?
I'm using the components and methods on template but it's still showing unused warnings.

Screenshot 2024-03-02 at 14 05 23 Screenshot 2024-03-02 at 14 05 30
@juzser juzser changed the title Issue with detection the used components & methods on template using pug v2.0.0 Issue with Pug template v2.0.0 - never read warning Mar 2, 2024
@JayPuff
Copy link

JayPuff commented Mar 4, 2024

I thought I was going crazy from running into the same issue after having set up my typescript/linting within our pug templates last week and having no issue. Unfortunate timing I guess.

Yeah, seems like it's a language tools v2.0 issue on composition API components, whether lang="ts" is on or not

Previously the work around for fake positives on 'never read' values were fixed by adding "@vue/language-plugin-pug" to the vueCompilerOptions on tsconfig, but I don't think that would make it an issue relating to that package

@richardsimko
Copy link

Option clicking on references in the template also no longer works, could be related.

@JayPuff
Copy link

JayPuff commented Mar 4, 2024

Option clicking on references in the template also no longer works, could be related.

Yeah likely the same issue, same for hovering over script variables in the template which would usually give type info

@fengjac
Copy link

fengjac commented Mar 5, 2024

Same issue

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Mar 5, 2024
@JayPuff
Copy link

JayPuff commented Mar 5, 2024

2.0.5 does not resolve the issue with the never read warning for me, even after re-installing the extension and rebooting vscode.

It also still does not validate ts within the template section, so it doesn't highlight things like calling a method with incorrect params, or have any type info on hover. while running vue-tsc will clearly show the ts errors within pug template.

Has anyone managed to get it to work for them?

I have this in my tsconfig.json as well since it was required before language tools v2.0:

"vueCompilerOptions": {
    "plugins": [
      "@vue/language-plugin-pug"
    ]
  }

environment details

Version: 1.87.0
Commit: 019f4d1419fbc8219a181fab7892ebccf7ee29a2
Date: 2024-02-27T23:42:16.599Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Linux x64 5.11.0-37-generic snap

@fardolieri
Copy link

Have you made sure to be on the latest version of @vue/language-plugin-pug? That fixed the problem for me.

npm i -D @vue/language-plugin-pug@latest

@JayPuff
Copy link

JayPuff commented Mar 5, 2024

Yep that worked, thank you so much 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants