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

221
Visualizações
Whenever I use jsconfig.json in a react project + VS Code to set up paths/alias's I lose the ability to cmd+click on an import to go to that file

So I have started adding a jsconfig.json file to my react projects in VS Code to enable me to use imports like:

import { Home, Expenses, Invoices } from '@/views';

instead of:

import { Home, Expenses, Invoices } from '../views';

My jsconfig file looks like this:

{
  "compilerOptions": {
    "module": "commonjs",
    "baseUrl": "src",
    "paths": {
      "@/*": ["/*"],
      "@/components/*": ["/components/*"],
      "@/views/*": ["/views/*"],
      "@/styles/*": ["/styles/*"]
    }
  },
  "include": ["src"],
  "exclude": ["node_modules"]
}

However one thing I have started to notice, is that whenever I do this I can no longer click on 'Home' say and be taken to the code/file. Instead it always brings up a popover that just shows references to the file. Nothing I click on within this reference popover will take me to the file. It looks like this:

popover example

Sometimes it doesn't even bring up the hover. It will just select the element in the open code block, if I click on the element it will just select the import at the top.

If I remove the '@' sign then everything works as intended.

Is there any way to use a jsconfig.json file with absolute imports/path alias' AND keep the ability to click on the import to go the file/code.

about 4 years ago · Juan Pablo Isaza
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