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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
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