DEV Community

Discussion on: How do I set up VSCode to edit typescript targeting ES3 and using custom @types?

Collapse
 
bugmagnet profile image
Bruce Axtens • Edited

My work around is as follows:

  • In my source folder I have a subfolder called "types". Into this I put JUNCTION links to folders that contain the @types folders that I want to reference.
  • In my tsconfig.json I have
  "include": [
    "*.ts",
    "./types"
  ]
Enter fullscreen mode Exit fullscreen mode

which causes VSCode to parse the declare statements therein.

I expect that I will still have to include a typeRoots so that compilation works. Currently the compilation process (which involves running tsc and then renaming the resulting .js files to .rr or .ri) complains about the symbols that VSCode can see but tsc can't.