Skip to content
Discussion options

You must be logged in to vote

IntelliSense in VS Code is driven by the TypeScript language service, which reads tsconfig.json/jsconfig.json — not your project’s package.json. There’s no package.json field the language service consults to inject global types, so there’s no trick to move it there.

The confusion is that the types field does matter, but only for a package’s own declarations: /// <reference types="cypress" /> resolves node_modules/cypress/package.jsontypes/index.d.ts. Your project’s package.json can’t register those Cypress globals (cy, Cypress, expect) for the editor.

The three supported ways (all editor-side):

// 1. per-file
/// <reference types="cypress" />
// 2. jsconfig.json (JS projects)
{ "include"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jennifer-shehane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants