15.1.4 • Published 6 years ago

eslint-plugin-testing-library-react v15.1.4

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

eslint-plugin-testing-library-react

ESLint plugin for React Testing Library rules guiding best practices.

Install

$ npm install --save eslint-plugin-testing-library-react

$ npx install-peerdeps --dev eslint-plugin-testing-library-react

Configuration

Use our preset to get reasonable defaults:

{
  "extends": ["plugin:testing-library-react/recommended"]
}

If you do not use a preset you will need to specify individual rules and add extra configuration.

Add testing-library-react to the plugins section.

{
  "plugins": ["testing-library-react"]
}

Enable the rules that you would like to use.

{
  "rules": {
    "testing-library-react/prefer-expect-query-by": "error"
  }
}

List of supported rules: