Package Exports
- tslint-plugin-cypress
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tslint-plugin-cypress) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
tslint-plugin-cypress
Set of tslint rules for testing with cypress.io.
Motivation
Main purpose of this package is to prevent working with return values of Cypress commands.
From cypress.io:
You cannot assign or work with the return values of any Cypress command. Commands are enqueued and run asynchronously.
How to use?
Typescript and tslint has to be installed and setup.
npm i -D tslint-plugin-cypress
Then add these to your tslint.json
file.
{
"extends": "tslint-plugin-cypress"
}
Run
./node_modules/.bin/tslint -c tslint.json -p . cypress/**/*.ts -t stylish
If you have troubles with setup, Look at example repo here.
Note: Unfortunately, VS code doesn't support plugins which requires type information.
Rules
no-chainable-assignment
Prevents assignment return values of Cypress commands (type Chainable
) to variables. Includes variable declaration, assignment to existing variable, object property assignment and array literal expressions.
no-chainable-arguments
Prevents passing return values of Cypress commands (type Chainable
) to function arguments.