testing-library / cypress-testing-library

🐅 Simple and complete custom Cypress commands and utilities that encourage good testing practices.
http://npm.im/@testing-library/cypress
MIT License
1.8k stars 152 forks source link

Mention ESLint configuration in docs #212

Open andymerskin opened 2 years ago

andymerskin commented 2 years ago

Problem description:

I configured Cypress Testing Library in my Typescript/ESLint repo using the standard instructions on the docs site: https://testing-library.com/docs/cypress-testing-library/intro/

When writing tests using find* commands, I immediately got some confusing ESLint errors, not knowing whether there was something wrong with these Cypress commands, their types, or something in my environment.

image

After about an hour of searching for a solution, out of sheer chance, I stumbled on the .eslintrc file in this repo's own test directory: https://github.com/testing-library/cypress-testing-library/blob/main/cypress/.eslintrc

Adding these ESLint rule overrides to my configuration fixed my issue.

Suggested solution:

Please add some documentation on the official Cypress Testing Library docs site — ESLint is extremely common in most projects these days, and many engineers may not know whether overriding these rules is the prescribed way to handle these errors or not — adding a quick section about this would save people hours of digging.

Thank you!

nickakey commented 2 years ago

I want to second this - I had the same problem and didn't know how to solve until I found this issue :/