How to resolve absolute import relative to src in nvim typescript

607 Views Asked by At

This is my first time trying to set up lazy-vim for javascript/typescript development. I have followed multiple blog posts and youtube channel to set things up. And it is working so far. Only problem is, the typescript lsp server is not able to resolve absolute imports relative to source folder.

Thanks for help.

Following are the contents of my jsconfig.json -


{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "baseUrl": "src/",
        "jsx": "react"
    },
    "include": ["src"]
}

Following is my typescript lsp setup -

 typescript.setup({
      go_to_source_definition = {
        fallback = true,
      },
      debug = false,
      disable_commands = false,
      server = {
        capabilities = capabilities,
        on_attach = on_attach,
      },
    })
0

There are 0 best solutions below