使用VSCodewith时,TypeScript我发现自己经常将鼠标悬停在函数或对象上以检查它们的类型。
通常,这些对象的类型和接口依赖于多个其他接口和类型。所以悬停不会提供太多信息。
要检查类型,我必须手动进入例如节点模块以查找类型声明并在那里检查它。
有没有办法轻松检查嵌套类型VSCode?
下面是一个例子:
我想要一种简单的方法来检查React.FunctionComponent.
我在本机反应上使用打字稿。当我的某个文件中有错误时,vscode 不会在“问题”选项卡中显示它,除非我打开了该文件。
tsconfig.json:
{
"extends": "@tsconfig/react-native/tsconfig.json"
}
Run Code Online (Sandbox Code Playgroud)
@tsconfig/react-native/tsconfig.json:
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "React Native",
"_version": "2.0.3",
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"types": ["react-native", "jest"],
"lib": [
"es2019"
],
"allowJs": true,
"jsx": "react-native",
"noEmit": true,
"isolatedModules": true,
"strict": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"exclude": [
"node_modules",
"babel.config.js",
"metro.config.js",
"jest.config.js"
]
}
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能使所有错误都显示在问题选项卡中并且侧栏中的文件具有红色下划线?