visual-studio-code - 如何停止检查 node_modules

标签 visual-studio-code

在小型项目中,我喜欢 MS Code 的自动检查。但是当项目开始引入 npm 依赖项时,它就变得毫无用处了

Completely unnecessary errors

有没有办法配置某些文件夹不被检查?我知道 "search.excludeFolders" 但它对解决这个问题毫无帮助。

最佳答案

如果您使用的是 TypeScript,您可以创建一个 tsconfig.json文件并选择 3 个选项之一:

  1. 提供要编译的文件的明确列表,从而防止任何 node_modules/* 显示错误。
  2. 不要提供明确的文件列表(默认所有 ./**/*.ts 文件都会被编译),而是将 tsconfig.json 放在你的文件中源文件夹,node_modules 自动从编译中排除。
  3. 使用新的 exclude tsconfig.json 中的功能(即将推出)。

关于visual-studio-code - 如何停止检查 node_modules,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30263928/

相关文章:

asp.net-core - 使用 VS Code 进行.NET Core 调试 - "Only 64-bit processes can be debugged"

javascript - create-react-app 子文件夹项目不 lint

visual-studio-code - 如何将用户设置传递给调试适配器?

visual-studio-code - 如何在 VS Code 中配置包装缩进大小?

python - 如何让 VS code 与 Pybuilder python 项目一起使用?

regex - 如何在 ' 中查找所有字符串,但排除包含 System.debug 的行

python - 如何在 Visual Studio Code 中设置 Python 虚拟环境?

visual-studio-code - 如何在基础数据更改时刷新Treeview

右键单击 VSCode 时,Flutter::My Refactor 按钮不会出现

typescript - VsCode 插件 : Color Coding inline SQL in ts file