eslint-plugin-cypress

raw JSON →
6.3.1 verified Sat Apr 25 auth: no javascript

An ESLint plugin providing lint rules and configurations for projects using Cypress testing framework. Current stable version is 6.3.1, released April 2026, with frequent minor/patch releases. Maintained by Cypress.io. Key differentiators: official Cypress linting, supports ESLint v9 and v10 (flat config only), TypeScript types included, provides globals and recommended configurations. Dropped support for legacy eslintrc config files in v6; flat config required.

error Error: Failed to load plugin 'cypress' declared in '...': Cannot find module 'eslint-plugin-cypress'
cause Plugin not installed or ESLint cannot resolve it
fix
npm install eslint-plugin-cypress --save-dev
error Error: Could not find config file: eslint.config.mjs
cause Missing or misnamed flat config file
fix
Create eslint.config.mjs (or .js/.cjs) in project root
error Error: Failed to load config "eslint-plugin-cypress/flat" to extend from.
cause Using deprecated /flat subpath in v6+
fix
Use 'eslint-plugin-cypress' instead of 'eslint-plugin-cypress/flat'
error Parsing error: The keyword 'import' is reserved
cause Using ESM syntax in a CommonJS file
fix
Set "type": "module" in package.json or rename file to .mjs
breaking Removed deprecated eslint-plugin-cypress/flat configuration in v6
fix Remove '/flat' suffix from import path; use 'eslint-plugin-cypress' directly
breaking Requires ESLint v9 or v10; eslintrc configs no longer supported
fix Upgrade ESLint to v9+ and migrate to flat config (eslint.config.mjs)
deprecated v5.4.0 was accidentally published with breaking changes from v6.0.0
fix Upgrade to v6.0.0 or later, or downgrade to v5.3.0
gotcha Globals are only available via configs.globals or configs.recommended; not automatically injected
fix Ensure you are extending one of the provided configs
gotcha ESLint installed globally requires eslint-plugin-cypress installed globally as well
fix Install both packages globally: npm install -g eslint eslint-plugin-cypress
npm install eslint-plugin-cypress
yarn add eslint-plugin-cypress
pnpm add eslint-plugin-cypress

Set up flat config with recommended rules for Cypress test files, adding custom rules.

// eslint.config.mjs
import pluginCypress from 'eslint-plugin-cypress'

export default [
  {
    files: ['cypress/e2e/**/*.cy.{js,jsx,ts,tsx}'],
    ...pluginCypress.configs.recommended,
    rules: {
      'cypress/no-unnecessary-waiting': 'warn',
      'cypress/assertion-before-screenshot': 'warn'
    }
  }
]