我正在React Native
使用Javascript
.
我希望 vscode 显示快速修复导入建议,如下所示:
问题是它也会显示typescript
错误,如下所示:
这是我的jsconfig.json
文件:
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"checkJs": true,
"jsx": "react-native"
},
"exclude": ["node_modules"],
"include": ["src/**/*"]
}
我已经意识到,如果我注释掉"checkJs": true,
错误就消失了,但是导入建议就不会再出现了。
这是我的settings.json
:
{
"workbench.iconTheme": "material-icon-theme",
"editor.fontFamily": "JetBrains Mono",
"editor.fontLigatures": true,
"editor.fontSize": 13,
"editor.formatOnSave": true,
"git.autofetch": true,
"git.confirmSync": false,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"terminal.external.osxExec": "iTerm.app",
"typescript.validate.enable": false,
"javascript.suggestionActions.enabled": true,
}
我已经阅读了很多帖子并尝试禁用typescript
和javascript
验证"typescript.validate.enable": false,
,但似乎没有任何效果。
有任何想法吗?我来自webstorm,所以我不太习惯vscode。
任何帮助将非常感激。谢谢!