Skip to content

Commit

Permalink
add ts config
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Oct 15, 2024
1 parent 0f96a3d commit adcd255
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// <reference types="cypress-if" />
```

Expand Down

0 comments on commit adcd255

Please sign in to comment.