{"name":"eslint-plugin-jest-dom","version":"5.9.1","keywords":["eslint","eslintplugin","eslint-plugin","jest-dom","testing-library","react-testing-library","dom-testing-library","RTL","DTL","tests"],"author":{"name":"Ben Monro"},"license":"MIT","_id":"eslint-plugin-jest-dom@5.9.1","maintainers":[{"name":"benmonro","email":"ben.monro@gmail.com"},{"name":"g-rath","email":"Jones258@Gmail.com"}],"homepage":"https://github.com/testing-library/eslint-plugin-jest-dom#readme","bugs":{"url":"https://github.com/testing-library/eslint-plugin-jest-dom/issues"},"dist":{"shasum":"af833a26e60515e4a1cd0d359942a6fc476c44c5","tarball":"http://registry-npm.ywwl.com/eslint-plugin-jest-dom/download/eslint-plugin-jest-dom-5.9.1.tgz","fileCount":21,"integrity":"sha512-lk2iCgj4yBT4bHokfpqeOcROpQ+E16puh2H0P8eHF9t1Of6edKrCP1hl5s5SNZ89wTBZ0by2UHqy0R05W90LoQ==","signatures":[{"sig":"MEUCIFn2wEboGyxZYJqPsJG31b9fReAUYQeRvvA51kL0mXT/AiEAkPjCLO3M8ApeZcZQqxfykmBvjQtzH7/vvbz/V9BsAD8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIAloK1HUd9QdmqXW4PUPjH9Sb04KOSopUq66TX8B1fzjAiBQmw3xGVlH0QcYvMjfMkRwxr7qKKMnD1oc+CsE9b62CQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/eslint-plugin-jest-dom@5.9.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":89169,"size":15745,"noattachment":false,"key":"/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-5.9.1.tgz"},"main":"dist/index.js","types":"index.d.ts","engines":{"npm":">=6","node":"^12.22.0 || ^14.17.0 || >=16.0.0","yarn":">=1"},"gitHead":"1e0a4c918c266e4f99244d7726cdec5681e71f9a","scripts":{"lint":"eslint .","test":"jest","build":"babel src --out-dir dist --delete-dir-on-start --copy-files --no-copy-ignored","setup":"npm install","test:update":"npm test:coverage -- --updateSnapshot","test:coverage":"npm test -- --coverage","regenerate-docs":"npm run build && eslint-doc-generator"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1bba33db-6e82-40bb-80be-316c40d668a2"}},"repository":{"url":"git+https://github.com/testing-library/eslint-plugin-jest-dom.git","type":"git"},"_npmVersion":"11.16.0","description":"ESLint plugin to follow best practices and anticipate common mistakes when writing tests with jest-dom","directories":{},"_nodeVersion":"24.18.0","dependencies":{"requireindex":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.1.3","eslint":"^8.7.0","semver":"^7.6.0","prettier":"^3.9.6","@babel/cli":"^7.29.7","typescript":"^5.1.3","@babel/preset-env":"^7.29.7","eslint-plugin-jest":"^29.16.0","@testing-library/dom":"^10.4.1","eslint-doc-generator":"^3.0.0","eslint-plugin-import":"^2.32.0","eslint-remote-tester":"^3.0.0","eslint-config-prettier":"^8.10.2","@typescript-eslint/parser":"^5.9.1","jest-snapshot-serializer-raw":"^1.2.0","eslint-remote-tester-repositories":"^1.0.1"},"peerDependencies":{"eslint":"^6.8.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0","@testing-library/dom":"^8.0.0 || ^9.0.0 || ^10.0.0"},"peerDependenciesMeta":{"@testing-library/dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-jest-dom_5.9.1_1785613328088_0.2682611601383147","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n<h1>eslint-plugin-jest-dom</h1>\n\n<p>ESLint plugin to follow best practices and anticipate common mistakes when writing tests with jest-dom.</p>\n</div>\n\n---\n\n<!-- prettier-ignore-start -->\n[![Build Status][build-badge]][build]\n[![Code Coverage][coverage-badge]][coverage]\n[![version][version-badge]][package]\n[![downloads][downloads-badge]][npmtrends]\n[![MIT License][license-badge]][license]\n[![All Contributors][all-contributors-badge]](#contributors-)\n[![PRs Welcome][prs-badge]][prs]\n[![Code of Conduct][coc-badge]][coc]\n<!-- prettier-ignore-end -->\n\n## Table of Contents\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Recommended Configuration](#recommended-configuration)\n- [Supported Rules](#supported-rules)\n- [Issues](#issues)\n  - [🐛 Bugs](#-bugs)\n  - [💡 Feature Requests](#-feature-requests)\n- [Contributors ✨](#contributors-)\n- [LICENSE](#license)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n## Installation\n\nThis module is distributed via [npm][npm] which is bundled with [node][node] and\nshould be installed as one of your project's `devDependencies`:\n\n```\nnpm install --save-dev eslint-plugin-jest-dom\n```\n\nThis library has a required `peerDependencies` listing for [`ESLint`](https://eslint.org/).\n\n## Usage\n\n> [!NOTE]\n>\n> `eslint.config.js` is supported, though most of the plugin documentation still\n> currently uses `.eslintrc` syntax; compatible versions of configs are available\n> prefixed with `flat/` and may be subject to small breaking changes while ESLint\n> v9 is being finalized.\n>\n> Refer to the\n> [ESLint documentation on the new configuration file format](https://eslint.org/docs/latest/use/configure/configuration-files-new)\n> for more.\n\nAdd `jest-dom` to the plugins section of your `.eslintrc.js` configuration file.\nYou can omit the `eslint-plugin-` prefix:\n\n```javascript\nmodule.exports = {\n  plugins: [\"jest-dom\"],\n  rules: {\n    // your configuration\n  },\n};\n```\n\nThen configure the rules you want to use under the rules section.\n\n```javascript\nmodule.exports = {\n  rules: {\n    \"jest-dom/prefer-checked\": \"error\",\n    \"jest-dom/prefer-enabled-disabled\": \"error\",\n    \"jest-dom/prefer-required\": \"error\",\n    \"jest-dom/prefer-to-have-attribute\": \"error\",\n  },\n};\n```\n\n## Recommended Configuration\n\nThis plugin exports a recommended configuration that enforces good `jest-dom`\npractices _(you can find more info about enabled rules in\n[Supported Rules section](#supported-rules))_.\n\nTo enable this configuration with `.eslintrc`, use the `extends` property:\n\n```javascript\nmodule.exports = {\n  extends: \"plugin:jest-dom/recommended\",\n  rules: {\n    // your configuration\n  },\n};\n```\n\nTo enable this configuration with `eslint.config.js`, use\n`jestDom.configs['flat/recommended']`:\n\n```javascript\nmodule.exports = [\n  {\n    files: [/* glob matching your test files */],\n    ...require(\"eslint-plugin-jest-dom\").configs[\"flat/recommended\"],\n  },\n];\n```\n\n## Supported Rules\n\n<!-- begin auto-generated rules list -->\n\n💼 Configurations enabled in.\\\n✅ Set in the `recommended` configuration.\\\n🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\\\n💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\n\n| Name                                                                     | Description                                                           | 💼  | 🔧  | 💡  |\n| :----------------------------------------------------------------------- | :-------------------------------------------------------------------- | :-- | :-- | :-- |\n| [prefer-checked](docs/rules/prefer-checked.md)                           | prefer toBeChecked over checking attributes                           | ✅  | 🔧  |     |\n| [prefer-empty](docs/rules/prefer-empty.md)                               | Prefer toBeEmpty over checking innerHTML                              | ✅  | 🔧  |     |\n| [prefer-enabled-disabled](docs/rules/prefer-enabled-disabled.md)         | prefer toBeDisabled or toBeEnabled over checking attributes           | ✅  | 🔧  |     |\n| [prefer-focus](docs/rules/prefer-focus.md)                               | prefer toHaveFocus over checking document.activeElement               | ✅  | 🔧  |     |\n| [prefer-in-document](docs/rules/prefer-in-document.md)                   | Prefer .toBeInTheDocument() for asserting the existence of a DOM node | ✅  | 🔧  | 💡  |\n| [prefer-pressed](docs/rules/prefer-pressed.md)                           | prefer toBePressed over checking attributes                           |     | 🔧  |     |\n| [prefer-required](docs/rules/prefer-required.md)                         | prefer toBeRequired over checking properties                          | ✅  | 🔧  |     |\n| [prefer-to-have-attribute](docs/rules/prefer-to-have-attribute.md)       | prefer toHaveAttribute over checking getAttribute/hasAttribute        | ✅  | 🔧  |     |\n| [prefer-to-have-class](docs/rules/prefer-to-have-class.md)               | prefer toHaveClass over checking element className                    | ✅  | 🔧  |     |\n| [prefer-to-have-style](docs/rules/prefer-to-have-style.md)               | prefer toHaveStyle over checking element style                        | ✅  | 🔧  |     |\n| [prefer-to-have-text-content](docs/rules/prefer-to-have-text-content.md) | Prefer toHaveTextContent over checking element.textContent            | ✅  | 🔧  |     |\n| [prefer-to-have-value](docs/rules/prefer-to-have-value.md)               | prefer toHaveValue over checking element.value                        | ✅  | 🔧  |     |\n\n<!-- end auto-generated rules list -->\n\n## Issues\n\n_Looking to contribute? Look for the [Good First Issue][good-first-issue]\nlabel._\n\n### 🐛 Bugs\n\nPlease file an issue for bugs, missing documentation, or unexpected behavior.\n\n[**See Bugs**][bugs]\n\n### 💡 Feature Requests\n\nPlease file an issue to suggest new features. Vote on feature requests by adding\na 👍. This helps maintainers prioritize what to work on.\n\n[**See Feature Requests**][requests]\n\n## Contributors ✨\n\nThanks goes to these people ([emoji key][emojis]):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/benmonro\"><img src=\"https://avatars3.githubusercontent.com/u/399236?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Ben Monro</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=benmonro\" title=\"Documentation\">📖</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=benmonro\" title=\"Code\">💻</a> <a href=\"#example-benmonro\" title=\"Examples\">💡</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=benmonro\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://nickmccurdy.com/\"><img src=\"https://avatars0.githubusercontent.com/u/927220?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Nick McCurdy</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=nickmccurdy\" title=\"Code\">💻</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=nickmccurdy\" title=\"Documentation\">📖</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=nickmccurdy\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://twitter.com/gnapse\"><img src=\"https://avatars0.githubusercontent.com/u/15199?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Ernesto García</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=gnapse\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://chriscolborne.com\"><img src=\"https://avatars2.githubusercontent.com/u/101371?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Chris Colborne</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=zorfling\" title=\"Code\">💻</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=zorfling\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://michaeldeboey.be\"><img src=\"https://avatars3.githubusercontent.com/u/6643991?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Michaël De Boey</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=MichaelDeBoey\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"http://gerritalex.de\"><img src=\"https://avatars1.githubusercontent.com/u/29307652?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Gerrit Alex</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=ljosberinn\" title=\"Code\">💻</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=ljosberinn\" title=\"Tests\">⚠️</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=ljosberinn\" title=\"Documentation\">📖</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3Aljosberinn\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"http://ololos.space/\"><img src=\"https://avatars1.githubusercontent.com/u/3940079?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Andrey Los</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3ARIP21\" title=\"Bug reports\">🐛</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"https://skovy.dev\"><img src=\"https://avatars1.githubusercontent.com/u/5247455?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Spencer Miskoviak</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=skovy\" title=\"Code\">💻</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=skovy\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://github.com/atsikov\"><img src=\"https://avatars3.githubusercontent.com/u/1422928?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Aleksei Tsikov</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3Aatsikov\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://mario.dev\"><img src=\"https://avatars1.githubusercontent.com/u/2677072?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Mario Beltrán Alarcón</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=Belco90\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://codepen.io/ariperkkio/\"><img src=\"https://avatars2.githubusercontent.com/u/14806298?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Ari Perkkiö</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3AAriPerkkio\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=AriPerkkio\" title=\"Code\">💻</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=AriPerkkio\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"http://www.antn.se\"><img src=\"https://avatars0.githubusercontent.com/u/785676?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Anton Niklasson</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=AntonNiklasson\" title=\"Code\">💻</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=AntonNiklasson\" title=\"Tests\">⚠️</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=AntonNiklasson\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"http://juzerzarif.com\"><img src=\"https://avatars3.githubusercontent.com/u/22772637?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Juzer Zarif</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=juzerzarif\" title=\"Code\">💻</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=juzerzarif\" title=\"Tests\">⚠️</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3Ajuzerzarif\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"http://everlong.org/\"><img src=\"https://avatars.githubusercontent.com/u/454175?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Julien Wajsberg</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=julienw\" title=\"Code\">💻</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=julienw\" title=\"Tests\">⚠️</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/G-Rath\"><img src=\"https://avatars.githubusercontent.com/u/3151613?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Gareth Jones</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=G-Rath\" title=\"Tests\">⚠️</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=G-Rath\" title=\"Code\">💻</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3AG-Rath\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://github.com/huyenltnguyen\"><img src=\"https://avatars.githubusercontent.com/u/25715018?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Huyen Nguyen</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=huyenltnguyen\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://github.com/mdotwills\"><img src=\"https://avatars.githubusercontent.com/u/5505611?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Matthew</b></sub></a><br /><a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3Amdotwills\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=mdotwills\" title=\"Code\">💻</a></td>\n  </tr>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors][all-contributors] specification.\nContributions of any kind welcome!\n\n## LICENSE\n\nMIT\n\n<!-- prettier-ignore-start -->\n[npm]: https://www.npmjs.com\n[node]: https://nodejs.org\n[build-badge]: https://img.shields.io/github/actions/workflow/status/testing-library/eslint-plugin-jest-dom/validate.yml?logo=github&style=flat-square\n[build]: https://github.com/testing-library/eslint-plugin-jest-dom/actions?query=workflow%3Avalidate\n[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/eslint-plugin-jest-dom.svg?style=flat-square\n[coverage]: https://codecov.io/github/testing-library/eslint-plugin-jest-dom\n[version-badge]: https://img.shields.io/npm/v/eslint-plugin-jest-dom.svg?style=flat-square\n[package]: https://www.npmjs.com/package/eslint-plugin-jest-dom\n[downloads-badge]: https://img.shields.io/npm/dm/eslint-plugin-jest-dom.svg?style=flat-square\n[npmtrends]: http://www.npmtrends.com/eslint-plugin-jest-dom\n[license-badge]: https://img.shields.io/npm/l/eslint-plugin-jest-dom.svg?style=flat-square\n[license]: https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n[coc]: https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/other/CODE_OF_CONDUCT.md\n[emojis]: https://github.com/all-contributors/all-contributors#emoji-key\n[all-contributors]: https://github.com/all-contributors/all-contributors\n[all-contributors-badge]: https://img.shields.io/github/all-contributors/testing-library/eslint-plugin-jest-dom?style=flat-square\n[bugs]: https://github.com/testing-library/eslint-plugin-jest-dom/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Acreated-desc+label%3Abug\n[requests]: https://github.com/testing-library/eslint-plugin-jest-dom/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement\n[good-first-issue]: https://github.com/testing-library/eslint-plugin-jest-dom/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement+label%3A%22good+first+issue%22\n<!-- prettier-ignore-end -->\n","publish_time":1785613328191,"_cnpm_publish_time":1785613328191,"dist-tags":{"latest":"5.10.1"}}