Tay*_*har 4 typescript visual-studio-code
我在本机反应上使用打字稿。当我的某个文件中有错误时,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)
我该怎么做才能使所有错误都显示在问题选项卡中并且侧栏中的文件具有红色下划线?
settings.json文件。"typescript.tsserver.experimental.enableProjectDiagnostics": true,
Run Code Online (Sandbox Code Playgroud)
这仍然是一个实验性功能。您可以在 GitHub 上跟踪此功能请求以获取更新。
| 归档时间: |
|
| 查看次数: |
1215 次 |
| 最近记录: |