Files
callstack__react-native-tes…/website/docs/EslintPLluginTestingLibrary.md
T
Pierre Zimmermann c42bae123d docs: add doc on compatibility with eslint-plugin-testing-library (#884)
* docs: add doc on compatibility with eslint-plugin-testing-library

* Update website/docs/EslintPLluginTestingLibrary.md

* Update website/docs/EslintPLluginTestingLibrary.md

Co-authored-by: pierrezimmermann <pierrez@nam.tech>
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2021-12-20 10:06:04 +01:00

1.6 KiB

id, title
id title
eslint-plugin-testing-library ESLint Plugin Testing Library Compatibility

Most of the rules of the eslint-plugin-testing-library are compatible with this library except the followings:

Also, some rules have become useless, unless maybe you're using an old version of the library:

To get the rule consistent-data-testid to work, you need to configure it to check the testID attribute by adding the following in your eslint config file, the testIdPattern being whichever pattern you want to enforce:

{
  "testing-library/consistent-data-testid": [
    2,
    {
      "testIdAttribute": ["testID"],
     "testIdPattern": "^TestId(__[A-Z]*)?$"
    }
  ]
}