Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

634
Visualizações
configure vscode react native auto-imports without ts errors

I'm working on a React Native project using Javascript.

I want vscode to display the quick fix imports suggestion like this one:

enter image description here

The problem is that it also displays typescript errors, like this one:

enter image description here

Here is my jsconfig.json file:

{
"compilerOptions": {
  "target": "ES6",
  "module": "commonjs",
  "allowSyntheticDefaultImports": true,
  "checkJs": true,
  "jsx": "react-native"
},
"exclude": ["node_modules"],
"include": ["src/**/*"]
}

I've realised that if I comment out "checkJs": true, the errors are gone but then the import suggestions doesn't appear anymore.

Here my 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,
}

I've already read many posts and played around disabling typescript and javascript validation "typescript.validate.enable": false, but nothing seems to work.

Any ideas? I'm coming from webstorm so I'm not really used to vscode.

Any help would be really appreciated. Thanks!

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I don't understand why you need a config for auto imports, but you could install the Auto import snippet from VSC snippets, here is the link try it.

also, the error from your typescript is not related to the auto import, it is a typescript error, your touchableOpacity still missing some props.

about 4 years ago · Juan Pablo Isaza Relatório

0

The best way is to create jsconfig.json and type in:

{
  "compilerOptions": {
    "module": "CommonJS",
    "jsx": "preserve",
    "checkJs": true
  },
  "exclude": ["node_modules", "**/node_modules/*"]
}

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda