Skip to content

Commit 7b338b8

Browse files
authored
add better ts config docs (#113)
1 parent 312c886 commit 7b338b8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,21 @@ import 'cypress-if'
4848

4949
### Types
5050

51-
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,
51+
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`
52+
53+
```jsonc
54+
"compilerOptions": {
55+
"types": [
56+
"cypress",
57+
"cypress-if" // add this line
58+
]
59+
}
60+
```
61+
62+
For JavaScript projects that cannot use `tsconfig.json` or `jscofig.json`, the special comment might do the trick:
5263

5364
```js
54-
// your spec file
65+
// your spec file "cypress/e2e/spec.cy.js" add this comment
5566
/// <reference types="cypress-if" />
5667
```
5768

0 commit comments

Comments
 (0)