From adcd255a9264167cd6b64cd83c8e14c4fd31f587 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Tue, 15 Oct 2024 10:47:41 -0400 Subject: [PATCH] add ts config --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e4412e..942769c 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,21 @@ import 'cypress-if' ### Types -Types for the `.if()` and `.else()` commands are described in the include typescript file [src/index.d.ts](./src/index.d.ts) file. If you need intellisense, include the type for this package. For example, +Types for the `.if()` and `.else()` commands are described in the include typescript file [src/index.d.ts](./src/index.d.ts) file. If you need intellisense, include the type for this package in your `tscofig.json` + +```jsonc +"compilerOptions": { + "types": [ + "cypress", + "cypress-if" // add this line + ] +} +``` + +For JavaScript projects that cannot use `tsconfig.json` or `jscofig.json`, the special comment might do the trick: ```js -// your spec file +// your spec file "cypress/e2e/spec.cy.js" add this comment /// ```