【发布时间】:2021-12-16 03:24:24
【问题描述】:
我安装了多个包,比如:
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
当我这样导入时(* 是从这些库中导出的东西):
import * from '@testing-library/jest-dom' // ok, vscode knows this and even auto imports
import * from '@testing-library/react' // vscode doesn't detect this
import * from '@testing-library/react-hooks' // vscode doesn't know what this is
我不知道为什么,因为它们被添加到package.json并正常安装。使用这些库的代码可以 100% 正常工作。问题是 VSCode 无法使用它们,没有路径自动导入,没有建议,没有参考......
【问题讨论】:
标签: visual-studio-code node-modules