Config for projects using Cypress for testing.
-
If you haven't already, make sure to install
@code-pushup/eslint-config
and its required peer dependencies. -
Since this plugin requires additional peer dependencies, you have to install them as well:
npm install -D eslint-plugin-cypress
-
Add to your
eslint.config.js
file:import cypress from '@code-pushup/eslint-config/cypress.js'; import tseslint from 'typescript-eslint'; export default tseslint.config(...cypress);
🔧 Automatically fixable by the
--fix
CLI option.
💡 Manually fixable by editor suggestions.
Plugin | Rule | Options | Autofix | Overrides |
---|---|---|---|---|
no-assigning-return-values disallow assigning return values of cy calls |
||||
no-async-tests disallow using async /await in Cypress test cases |
||||
no-unnecessary-waiting disallow waiting for arbitrary time periods |
||||
unsafe-to-chain-command disallow actions within chains |
Plugin | Rule | Options | Autofix | Overrides |
---|---|---|---|---|
no-force disallow using force: true with action commands |
||||
no-pause disallow using cy.pause() calls |