ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library. You can find detailed guides for migrating eslint-plugin-testing-library in the migration guide docs. Add testing-library to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix. With the default setup mentioned before, eslint-plugin-testing-library will be run against your whole codebase. You can run this plugin only against your tests files. One way of restricting ESLint config by file patterns is by using ESLint overrides. Another approach for customizing ESLint config by paths is through ESLint Cascading and Hierarchy. This is useful if all your tests are placed under the same folder, so you can place there another .eslintrc where you enable eslint-plugin-testing-library for applying it only to the files under such folder, rather than enabling it on your global .eslintrc which would apply to your whole project.

Features

  • You'll first need to install ESLint
  • You can run this plugin only against your tests files
  • ESLint overrides
  • Run the plugin only against test files
  • Shareable configurations
  • DOM Testing Library

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow eslint-plugin-testing-library

eslint-plugin-testing-library Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of eslint-plugin-testing-library!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

TypeScript

Related Categories

TypeScript Source Code Analysis Tool

Registered

2022-10-21