Synthetixio / synpress

Synpress is e2e testing framework based on Cypress.io and playwright with support for metamask.
https://synpress.io
MIT License
580 stars 186 forks source link

ESLint couldn't find the plugin "eslint-plugin-cypress". #580

Open doliG opened 1 year ago

doliG commented 1 year ago

Hey, I have this error during my pre commit hook.

$ git commit
✔ Preparing lint-staged...
❯ Running tasks for staged files...
  ❯ packages/frontend/.lintstagedrc.json — 2 files
    ❯ **/*.ts?(x) — 2 files
      ✖ eslint --fix [FAILED]
      ◼ prettier --write
↓ Skipped because of errors from tasks. [SKIPPED]
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...

✖ eslint --fix:

Oops! Something went wrong! :(

ESLint: 8.22.0

ESLint couldn't find the plugin "eslint-plugin-cypress".

(The package "eslint-plugin-cypress" was not found when loaded as a Node module from the directory "~/workspaces/crossfuji/packages/frontend/tests/e2e".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm install eslint-plugin-cypress@latest --save-dev

The plugin "eslint-plugin-cypress" was referenced from the config file in "tests/e2e/.eslintrc.json » ../../../../node_modules/@synthetixio/synpress/.eslintrc.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

husky - pre-commit hook exited with code 1 (error)

The weird thing is that this package is installed, but it seems like eslint can't find it 🤔

$ yarn list --pattern "eslint-plugin-cypress"
yarn list v1.22.19
└─ eslint-plugin-cypress@2.12.1
✨  Done in 0.56s.

Any idea ?

drptbl commented 1 year ago

Hey @doliG,

is there any way I can reproduce this on my own PC?

is your repository public?

Thanks, Jakub.

doliG commented 1 year ago

Hey @drptbl , thank you for your reply.

Yes the repo is public: Fujicracy/fuji-v2 Since it's a yarn monorepo please install deps from root folder with yarn, then go to packages/frontend