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

eslint testing-library in conflict with cypress-testing-library #226

Open dominikabieder opened 2 years ago

dominikabieder commented 2 years ago

I've followed the instructions from testing-library, but no matter what I have, eslint seems to reject each and every function (findByRole, findByLabelText, findByText, findByDisplayValue).

Any idea how to get rid of these?

Screenshot 2022-07-21 at 12 42 02

I've added to commands.ts import "@testing-library/cypress/add-commands";

in package.json I have "@testing-library/cypress": "8.0.3",

in tsconfig.json

"compilerOptions": {
  "types": ["cypress", "@testing-library/cypress", "node"]
  },
  "include": ["src", "**/*.ts" ],

in .eslintrc.json

 "plugins": [
    "@typescript-eslint",
    "react-hooks",
    "prettier",
    "testing-library",
    "jest-dom",
    "cypress"
  ],
  "extends": [
    "plugin:react/recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier",
    "plugin:testing-library/react",
    "plugin:jest-dom/recommended",
    "plugin:cypress/recommended"
  ],
thenderson55 commented 2 years ago

Same issue - I have commented out "plugin:testing-library/react" for now.