简体   繁体   English

VSCode Typescript 版本和 linter 不起作用

[英]VSCode Typescript Version and linter not working

On Visual Studio code IDE I had the following issues:在 Visual Studio 代码 IDE 上,我遇到了以下问题:

  • The TypeScript version at the bottom right of the screen was not showing.屏幕右下角的 TypeScript 版本没有显示。
  • Linter not working for any of my projects. Linter 不适用于我的任何项目。
  • "Typescript : Select Typescript Version" setting was missing from the command palette命令面板中缺少“打字稿:选择打字稿版本”设置

This is after trying the suggestions from other stackoverflow articles:这是在尝试了其他 stackoverflow 文章中的建议之后:

And lastly attempting to follow along with VSCodes documentation in order to attempt to fix the problem.最后尝试遵循 VSCodes 文档以尝试解决问题。

Installing typescript globally did not rectify this issue either.全局安装 typescript 也没有解决这个问题。

So I managed to solve my issue by completely uninstalling VS Code, getting the latest version and installing it.所以我设法通过完全卸载 VS Code、获取最新版本并安装它来解决我的问题。 steps:脚步:

Windows:视窗:

  1. Control panel > Uninstall a program > VSCode控制面板 > 卸载程序 > VSCode
  2. Delete directory C:\\Users{user}\\AppData\\Roaming\\Code删除目录 C:\\Users{user}\\AppData\\Roaming\\Code
  3. Delete directory C:\\Users{user}.vscode删除目录 C:\\Users{user}.vscode
  4. Download and install latest from: https://code.visualstudio.com/从以下位置下载并安装最新版本: https : //code.visualstudio.com/

Success!成功!

I found myself in a similar situation, except other projects worked.我发现自己处于类似的情况,除了其他项目有效。 The solution in my case was to search for the @builtin typescript extension and choose "Enable (Workspace)" from the contextual menu ("Enable" is grayed out).在我的情况下,解决方案是搜索@builtin typescript扩展并从上下文菜单中选择“启用(工作区)”(“启用”变灰)。 Still not sure why it was disabled for this project.仍然不确定为什么它被这个项目禁用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM