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
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
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