我有一个使用 Typescript 的 Monorepo。我有一个 common 文件夹,它在文件顶部显示此错误 ->
Entry point for implicit type library 'glob'
。我不确定配置有什么问题。
截图:
tsconfig.json
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-native",
"lib": [
"es2021"
],
"moduleResolution": "node",
"noEmit": false,
"strict": true,
"target": "esnext",
"composite": true,
"rootDir": ".",
"outDir": "dist",
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true
},
"exclude": [
"node_modules",
]
}
有什么建议吗?
我刚刚重新启动 VS Code,错误消失了。
在您的“编译器选项”中包含“类型”...
{
"compilerOptions": {
"types": [
// ... your other types
"node"
],
},
}