Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/// <reference types= "cypress" /> not enabling intellisense in VS code

I'm having a problem trying to get code completion for Cypress while I'm using JS. I've tried following every bit of documentation I could found, but I don't find these comprehensive enough.

like image 746
Cristian Marin Avatar asked Mar 14 '19 14:03

Cristian Marin


2 Answers

None of these worked for me, what finally gave me Intellisense was adding a tsconfig.json file to the Cypress folder, as per the Cypress docs:

{
  "compilerOptions": {
    "allowJs": true,
    "baseUrl": "../node_modules",
    "types": ["cypress"]
  },
  "include": ["**/*.*"]
}
like image 126
karfus Avatar answered Sep 29 '22 12:09

karfus


I just added

  "compilerOptions": {
    "types": ["cypress"]
  }

to the object in the tsconfig.json file that was in the root cypress directory. I then chose "Restart TS Server" from the Command Palette and that sorted things out for me.

like image 39
Shafiq Jetha Avatar answered Sep 29 '22 10:09

Shafiq Jetha