{"id":13496474,"url":"https://github.com/jest-community/eslint-plugin-jest","last_synced_at":"2026-02-15T20:04:55.154Z","repository":{"id":37942146,"uuid":"110028636","full_name":"jest-community/eslint-plugin-jest","owner":"jest-community","description":"ESLint plugin for Jest ","archived":false,"fork":false,"pushed_at":"2026-02-12T19:59:56.000Z","size":32765,"stargazers_count":1167,"open_issues_count":23,"forks_count":249,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-02-13T03:34:28.210Z","etag":null,"topics":["eslint","eslint-plugin","jest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jest-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-11-08T20:46:32.000Z","updated_at":"2026-02-12T19:59:58.000Z","dependencies_parsed_at":"2026-01-19T08:03:19.732Z","dependency_job_id":null,"html_url":"https://github.com/jest-community/eslint-plugin-jest","commit_stats":{"total_commits":1422,"total_committers":142,"mean_commits":"10.014084507042254","dds":0.7369901547116737,"last_synced_commit":"c223c1a7e43f077a18fbcd6e9de67ffbda2af525"},"previous_names":[],"tags_count":329,"template":false,"template_full_name":null,"purl":"pkg:github/jest-community/eslint-plugin-jest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-community%2Feslint-plugin-jest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-community%2Feslint-plugin-jest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-community%2Feslint-plugin-jest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-community%2Feslint-plugin-jest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jest-community","download_url":"https://codeload.github.com/jest-community/eslint-plugin-jest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jest-community%2Feslint-plugin-jest/sbom","scorecard":{"id":516770,"data":{"date":"2025-08-11","repo":{"name":"github.com/jest-community/eslint-plugin-jest","commit":"999d3db281143a1da0fd727ef5ca12119eac4622"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 13 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'statuses' permission set to 'write': .github/workflows/lint.yml:27","Info: jobLevel 'contents' permission set to 'read': .github/workflows/lint.yml:24","Info: jobLevel 'contents' permission set to 'read': .github/workflows/smoke-test.yml:14","Info: jobLevel 'pull-requests' permission set to 'read': .github/workflows/smoke-test.yml:16","Info: topLevel 'contents' permission set to 'read': .github/workflows/lint.yml:7","Info: topLevel 'contents' permission set to 'read': .github/workflows/markdown-link-check.yml:13","Info: topLevel 'contents' permission set to 'read': .github/workflows/nodejs.yml:19","Warn: no topLevel permission defined: .github/workflows/prepare-cache.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/smoke-test.yml:9","Warn: no topLevel permission defined: .github/workflows/test.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/markdown-link-check.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/markdown-link-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/markdown-link-check.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/markdown-link-check.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/nodejs.yml:101: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:126: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:127: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:156: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:159: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prepare-cache.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/prepare-cache.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prepare-cache.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/prepare-cache.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke-test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/smoke-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke-test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/smoke-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/smoke-test.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/smoke-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/jest-community/eslint-plugin-jest/test.yml/main?enable=pin","Info:   0 out of  20 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T02:01:49.703Z","repository_id":37942146,"created_at":"2025-08-20T02:01:49.703Z","updated_at":"2025-08-20T02:01:49.703Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29486072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T15:33:17.885Z","status":"ssl_error","status_checked_at":"2026-02-15T15:32:53.698Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","eslint-plugin","jest"],"created_at":"2024-07-31T19:01:48.424Z","updated_at":"2026-02-15T20:04:55.128Z","avatar_url":"https://github.com/jest-community.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Packages","Plugins"],"sub_categories":["Linting","Testing Tools"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://eslint.org/\"\u003e\n    \u003cimg height=\"150\" src=\"https://eslint.org/assets/images/logo/eslint-logo-color.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://jestjs.io/\"\u003e\n    \u003cimg width=\"150\" height=\"150\" vspace=\"\" hspace=\"25\" src=\"https://jestjs.io/img/jest.png\"\u003e\n  \u003c/a\u003e\n  \u003ch1\u003eeslint-plugin-jest\u003c/h1\u003e\n  \u003cp\u003eESLint plugin for Jest\u003c/p\u003e\n\u003c/div\u003e\n\n[![Actions Status](https://github.com/jest-community/eslint-plugin-jest/actions/workflows/nodejs.yml/badge.svg?branch=main)](https://github.com/jest-community/eslint-plugin-jest/actions)\n\n## Installation\n\n```bash\nyarn add --dev eslint eslint-plugin-jest\n```\n\n**Note:** If you installed ESLint globally then you must also install\n`eslint-plugin-jest` globally.\n\n## Usage\n\nIf you're using flat configuration:\n\nWith\n[flat configuration](https://eslint.org/docs/latest/use/configure/configuration-files),\njust import the plugin and away you go:\n\n```js\nconst pluginJest = require('eslint-plugin-jest');\n\nmodule.exports = [\n  {\n    // update this to match your test files\n    files: ['**/*.spec.js', '**/*.test.js'],\n    plugins: { jest: pluginJest },\n    languageOptions: {\n      globals: pluginJest.environments.globals.globals,\n    },\n    rules: {\n      'jest/no-disabled-tests': 'warn',\n      'jest/no-focused-tests': 'error',\n      'jest/no-identical-title': 'error',\n      'jest/prefer-to-have-length': 'warn',\n      'jest/valid-expect': 'error',\n    },\n  },\n];\n```\n\nWith legacy configuration, add `jest` to the plugins section of your `.eslintrc`\nconfiguration file. You can omit the `eslint-plugin-` prefix:\n\n```json\n{\n  \"plugins\": [\"jest\"],\n  \"env\": {\n    \"jest/globals\": true\n  },\n  \"rules\": {\n    \"jest/no-disabled-tests\": \"warn\",\n    \"jest/no-focused-tests\": \"error\",\n    \"jest/no-identical-title\": \"error\",\n    \"jest/prefer-to-have-length\": \"warn\",\n    \"jest/valid-expect\": \"error\"\n  }\n}\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e You only need to explicitly include our globals if you're not using one of our\n\u003e shared configs\n\n#### Aliased Jest globals\n\nYou can tell this plugin about any global Jests you have aliased using the\n`globalAliases` setting:\n\n```json\n{\n  \"settings\": {\n    \"jest\": {\n      \"globalAliases\": {\n        \"describe\": [\"context\"],\n        \"fdescribe\": [\"fcontext\"],\n        \"xdescribe\": [\"xcontext\"]\n      }\n    }\n  }\n}\n```\n\n#### Aliased `@jest/globals`\n\nYou can tell this plugin to treat a different package as the source of Jest\nglobals using the `globalPackage` setting:\n\n```json\n{\n  \"settings\": {\n    \"jest\": {\n      \"globalPackage\": \"bun:test\"\n    }\n  }\n}\n```\n\n\u003e [!WARNING]\n\u003e\n\u003e While this can be used to apply rules when using alternative testing libraries\n\u003e and frameworks like `bun`, `vitest` and `node`, there's no guarantee the\n\u003e semantics this plugin assumes will hold outside of Jest\n\n### Running rules only on test-related files\n\nThe rules provided by this plugin assume that the files they are checking are\ntest-related. This means it's generally not suitable to include them in your\ntop-level configuration as that applies to all files being linted which can\ninclude source files.\n\nFor `.eslintrc` configs you can use\n[overrides](https://eslint.org/docs/user-guide/configuring/configuration-files#how-do-overrides-work)\nto have ESLint apply additional rules to specific files:\n\n```json\n{\n  \"extends\": [\"eslint:recommended\"],\n  \"overrides\": [\n    {\n      \"files\": [\"test/**\"],\n      \"plugins\": [\"jest\"],\n      \"extends\": [\"plugin:jest/recommended\"],\n      \"rules\": { \"jest/prefer-expect-assertions\": \"off\" }\n    }\n  ],\n  \"rules\": {\n    \"indent\": [\"error\", 2]\n  }\n}\n```\n\nFor `eslint.config.js` you can use\n[`files` and `ignores`](https://eslint.org/docs/latest/use/configure/configuration-files-new#specifying-files-and-ignores):\n\n```js\nconst jest = require('eslint-plugin-jest');\n\nmodule.exports = [\n  ...require('@eslint/js').configs.recommended,\n  {\n    files: ['test/**'],\n    ...jest.configs['flat/recommended'],\n    rules: {\n      ...jest.configs['flat/recommended'].rules,\n      'jest/prefer-expect-assertions': 'off',\n    },\n  },\n  // you can also configure jest rules in other objects, so long as some of the `files` match\n  {\n    files: ['test/**'],\n    rules: { 'jest/prefer-expect-assertions': 'off' },\n  },\n];\n```\n\n### Jest `version` setting\n\nThe behaviour of some rules (specifically [`no-deprecated-functions`][]) change\ndepending on the version of Jest being used.\n\nBy default, this plugin will attempt to determine to locate Jest using\n`require.resolve`, meaning it will start looking in the closest `node_modules`\nfolder to the file being linted and work its way up.\n\nSince we cache the automatically determined version, if you're linting\nsub-folders that have different versions of Jest, you may find that the wrong\nversion of Jest is considered when linting. You can work around this by\nproviding the Jest version explicitly in nested ESLint configs:\n\n```json\n{\n  \"settings\": {\n    \"jest\": {\n      \"version\": 27\n    }\n  }\n}\n```\n\nTo avoid hard-coding a number, you can also fetch it from the installed version\nof Jest if you use a JavaScript config file such as `.eslintrc.js`:\n\n```js\nmodule.exports = {\n  settings: {\n    jest: {\n      version: require('jest/package.json').version,\n    },\n  },\n};\n```\n\n## Shareable configurations\n\n\u003e [!NOTE]\n\u003e\n\u003e `eslint.config.js` compatible versions of configs are available prefixed with\n\u003e `flat/` and may be subject to small breaking changes while ESLint v9 is being\n\u003e finalized.\n\n### Recommended\n\nThis plugin exports a recommended configuration that enforces good testing\npractices.\n\nTo enable this configuration with `.eslintrc`, use the `extends` property:\n\n```json\n{\n  \"extends\": [\"plugin:jest/recommended\"]\n}\n```\n\nTo enable this configuration with `eslint.config.js`, use\n`jest.configs['flat/recommended']`:\n\n```js\nconst jest = require('eslint-plugin-jest');\n\nmodule.exports = [\n  {\n    files: [\n      /* glob matching your test files */\n    ],\n    ...jest.configs['flat/recommended'],\n  },\n];\n```\n\n### Style\n\nThis plugin also exports a configuration named `style`, which adds some\nstylistic rules, such as `prefer-to-be-null`, which enforces usage of `toBeNull`\nover `toBe(null)`.\n\nTo enable this configuration use the `extends` property in your `.eslintrc`\nconfig file:\n\n```json\n{\n  \"extends\": [\"plugin:jest/style\"]\n}\n```\n\nTo enable this configuration with `eslint.config.js`, use\n`jest.configs['flat/style']`:\n\n```js\nconst jest = require('eslint-plugin-jest');\n\nmodule.exports = [\n  {\n    files: [\n      /* glob matching your test files */\n    ],\n    ...jest.configs['flat/style'],\n  },\n];\n```\n\n### All\n\nIf you want to enable all rules instead of only some you can do so by adding the\n`all` configuration to your `.eslintrc` config file:\n\n```json\n{\n  \"extends\": [\"plugin:jest/all\"]\n}\n```\n\nTo enable this configuration with `eslint.config.js`, use\n`jest.configs['flat/all']`:\n\n```js\nconst jest = require('eslint-plugin-jest');\n\nmodule.exports = [\n  {\n    files: [\n      /* glob matching your test files */\n    ],\n    ...jest.configs['flat/all'],\n  },\n];\n```\n\nWhile the `recommended` and `style` configurations only change in major versions\nthe `all` configuration may change in any release and is thus unsuited for\ninstallations requiring long-term consistency.\n\n## Rules\n\n\u003c!-- begin auto-generated rules list --\u003e\n\n💼\n[Configurations](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations)\nenabled in.\\\n⚠️ [Configurations](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations)\nset to warn in.\\\n✅ Set in the `recommended`\n[configuration](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations).\\\n🎨\nSet in the `style`\n[configuration](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations).\\\n🔧\nAutomatically fixable by the\n[`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\\\n💡\nManually fixable by\n[editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\n\n| Name                                                                                 | Description                                                               | 💼  | ⚠️  | 🔧  | 💡  |\n| :----------------------------------------------------------------------------------- | :------------------------------------------------------------------------ | :-- | :-- | :-- | :-- |\n| [consistent-test-it](docs/rules/consistent-test-it.md)                               | Enforce `test` and `it` usage conventions                                 |     |     | 🔧  |     |\n| [expect-expect](docs/rules/expect-expect.md)                                         | Enforce assertion to be made in a test body                               |     | ✅  |     |     |\n| [max-expects](docs/rules/max-expects.md)                                             | Enforces a maximum number assertion calls in a test body                  |     |     |     |     |\n| [max-nested-describe](docs/rules/max-nested-describe.md)                             | Enforces a maximum depth to nested describe calls                         |     |     |     |     |\n| [no-alias-methods](docs/rules/no-alias-methods.md)                                   | Disallow alias methods                                                    | ✅  |     | 🔧  |     |\n| [no-commented-out-tests](docs/rules/no-commented-out-tests.md)                       | Disallow commented out tests                                              |     | ✅  |     |     |\n| [no-conditional-expect](docs/rules/no-conditional-expect.md)                         | Disallow calling `expect` conditionally                                   | ✅  |     |     |     |\n| [no-conditional-in-test](docs/rules/no-conditional-in-test.md)                       | Disallow conditional logic in tests                                       |     |     |     |     |\n| [no-confusing-set-timeout](docs/rules/no-confusing-set-timeout.md)                   | Disallow confusing usages of jest.setTimeout                              |     |     |     |     |\n| [no-deprecated-functions](docs/rules/no-deprecated-functions.md)                     | Disallow use of deprecated functions                                      | ✅  |     | 🔧  |     |\n| [no-disabled-tests](docs/rules/no-disabled-tests.md)                                 | Disallow disabled tests                                                   |     | ✅  |     |     |\n| [no-done-callback](docs/rules/no-done-callback.md)                                   | Disallow using a callback in asynchronous tests and hooks                 | ✅  |     |     | 💡  |\n| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md)                               | Disallow duplicate setup and teardown hooks                               |     |     |     |     |\n| [no-export](docs/rules/no-export.md)                                                 | Disallow using `exports` in files containing tests                        | ✅  |     |     |     |\n| [no-focused-tests](docs/rules/no-focused-tests.md)                                   | Disallow focused tests                                                    | ✅  |     |     | 💡  |\n| [no-hooks](docs/rules/no-hooks.md)                                                   | Disallow setup and teardown hooks                                         |     |     |     |     |\n| [no-identical-title](docs/rules/no-identical-title.md)                               | Disallow identical titles                                                 | ✅  |     |     |     |\n| [no-interpolation-in-snapshots](docs/rules/no-interpolation-in-snapshots.md)         | Disallow string interpolation inside snapshots                            | ✅  |     |     |     |\n| [no-jasmine-globals](docs/rules/no-jasmine-globals.md)                               | Disallow Jasmine globals                                                  | ✅  |     | 🔧  |     |\n| [no-large-snapshots](docs/rules/no-large-snapshots.md)                               | Disallow large snapshots                                                  |     |     |     |     |\n| [no-mocks-import](docs/rules/no-mocks-import.md)                                     | Disallow manually importing from `__mocks__`                              | ✅  |     |     |     |\n| [no-restricted-jest-methods](docs/rules/no-restricted-jest-methods.md)               | Disallow specific `jest.` methods                                         |     |     |     |     |\n| [no-restricted-matchers](docs/rules/no-restricted-matchers.md)                       | Disallow specific matchers \u0026 modifiers                                    |     |     |     |     |\n| [no-standalone-expect](docs/rules/no-standalone-expect.md)                           | Disallow using `expect` outside of `it` or `test` blocks                  | ✅  |     |     |     |\n| [no-test-prefixes](docs/rules/no-test-prefixes.md)                                   | Require using `.only` and `.skip` over `f` and `x`                        | ✅  |     | 🔧  |     |\n| [no-test-return-statement](docs/rules/no-test-return-statement.md)                   | Disallow explicitly returning from tests                                  |     |     |     |     |\n| [no-unneeded-async-expect-function](docs/rules/no-unneeded-async-expect-function.md) | Disallow unnecessary async function wrapper for expected promises         |     |     | 🔧  |     |\n| [no-untyped-mock-factory](docs/rules/no-untyped-mock-factory.md)                     | Disallow using `jest.mock()` factories without an explicit type parameter |     |     | 🔧  |     |\n| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md)     | Enforce padding around `afterAll` blocks                                  |     |     | 🔧  |     |\n| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md)   | Enforce padding around `afterEach` blocks                                 |     |     | 🔧  |     |\n| [padding-around-all](docs/rules/padding-around-all.md)                               | Enforce padding around Jest functions                                     |     |     | 🔧  |     |\n| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md)   | Enforce padding around `beforeAll` blocks                                 |     |     | 🔧  |     |\n| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | Enforce padding around `beforeEach` blocks                                |     |     | 🔧  |     |\n| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md)       | Enforce padding around `describe` blocks                                  |     |     | 🔧  |     |\n| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md)           | Enforce padding around `expect` groups                                    |     |     | 🔧  |     |\n| [padding-around-test-blocks](docs/rules/padding-around-test-blocks.md)               | Enforce padding around `test` and `it` blocks                             |     |     | 🔧  |     |\n| [prefer-called-with](docs/rules/prefer-called-with.md)                               | Suggest using `toHaveBeenCalledWith()`                                    |     |     |     |     |\n| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md)                 | Suggest using the built-in comparison matchers                            |     |     | 🔧  |     |\n| [prefer-each](docs/rules/prefer-each.md)                                             | Prefer using `.each` rather than manual loops                             |     |     |     |     |\n| [prefer-ending-with-an-expect](docs/rules/prefer-ending-with-an-expect.md)           | Prefer having the last statement in a test be an assertion                |     |     |     |     |\n| [prefer-equality-matcher](docs/rules/prefer-equality-matcher.md)                     | Suggest using the built-in equality matchers                              |     |     |     | 💡  |\n| [prefer-expect-assertions](docs/rules/prefer-expect-assertions.md)                   | Suggest using `expect.assertions()` OR `expect.hasAssertions()`           |     |     |     | 💡  |\n| [prefer-expect-resolves](docs/rules/prefer-expect-resolves.md)                       | Prefer `await expect(...).resolves` over `expect(await ...)` syntax       |     |     | 🔧  |     |\n| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md)                         | Prefer having hooks in a consistent order                                 |     |     |     |     |\n| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md)                             | Suggest having hooks before any test cases                                |     |     |     |     |\n| [prefer-importing-jest-globals](docs/rules/prefer-importing-jest-globals.md)         | Prefer importing Jest globals                                             |     |     | 🔧  |     |\n| [prefer-jest-mocked](docs/rules/prefer-jest-mocked.md)                               | Prefer `jest.mocked()` over `fn as jest.Mock`                             |     |     | 🔧  |     |\n| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md)                       | Enforce lowercase test names                                              |     |     | 🔧  |     |\n| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md)         | Prefer mock resolved/rejected shorthands for promises                     |     |     | 🔧  |     |\n| [prefer-mock-return-shorthand](docs/rules/prefer-mock-return-shorthand.md)           | Prefer mock return shorthands                                             |     |     | 🔧  |     |\n| [prefer-snapshot-hint](docs/rules/prefer-snapshot-hint.md)                           | Prefer including a hint with external snapshots                           |     |     |     |     |\n| [prefer-spy-on](docs/rules/prefer-spy-on.md)                                         | Suggest using `jest.spyOn()`                                              |     |     | 🔧  |     |\n| [prefer-strict-equal](docs/rules/prefer-strict-equal.md)                             | Suggest using `toStrictEqual()`                                           |     |     |     | 💡  |\n| [prefer-to-be](docs/rules/prefer-to-be.md)                                           | Suggest using `toBe()` for primitive literals                             | 🎨  |     | 🔧  |     |\n| [prefer-to-contain](docs/rules/prefer-to-contain.md)                                 | Suggest using `toContain()`                                               | 🎨  |     | 🔧  |     |\n| [prefer-to-have-been-called](docs/rules/prefer-to-have-been-called.md)               | Suggest using `toHaveBeenCalled`                                          |     |     | 🔧  |     |\n| [prefer-to-have-been-called-times](docs/rules/prefer-to-have-been-called-times.md)   | Suggest using `toHaveBeenCalledTimes()`                                   |     |     | 🔧  |     |\n| [prefer-to-have-length](docs/rules/prefer-to-have-length.md)                         | Suggest using `toHaveLength()`                                            | 🎨  |     | 🔧  |     |\n| [prefer-todo](docs/rules/prefer-todo.md)                                             | Suggest using `test.todo`                                                 |     |     | 🔧  |     |\n| [require-hook](docs/rules/require-hook.md)                                           | Require setup and teardown code to be within a hook                       |     |     |     |     |\n| [require-to-throw-message](docs/rules/require-to-throw-message.md)                   | Require a message for `toThrow()`                                         |     |     |     |     |\n| [require-top-level-describe](docs/rules/require-top-level-describe.md)               | Require test cases and hooks to be inside a `describe` block              |     |     |     |     |\n| [valid-describe-callback](docs/rules/valid-describe-callback.md)                     | Enforce valid `describe()` callback                                       | ✅  |     |     |     |\n| [valid-expect](docs/rules/valid-expect.md)                                           | Enforce valid `expect()` usage                                            | ✅  |     | 🔧  |     |\n| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md)                     | Require promises that have expectations in their chain to be valid        | ✅  |     |     |     |\n| [valid-mock-module-path](docs/rules/valid-mock-module-path.md)                       | Disallow mocking of non-existing module paths                             |     |     |     |     |\n| [valid-title](docs/rules/valid-title.md)                                             | Enforce valid titles                                                      | ✅  |     | 🔧  |     |\n\n### Requires Type Checking\n\n| Name                                                                 | Description                                                                                 | 💼  | ⚠️  | 🔧  | 💡  |\n| :------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ | :-- | :-- | :-- | :-- |\n| [no-error-equal](docs/rules/no-error-equal.md)                       | Disallow using equality matchers on error types                                             |     |     |     |     |\n| [no-unnecessary-assertion](docs/rules/no-unnecessary-assertion.md)   | Disallow unnecessary assertions based on types                                              |     |     |     |     |\n| [unbound-method](docs/rules/unbound-method.md)                       | Enforce unbound methods are called with their expected scope                                |     |     |     |     |\n| [valid-expect-with-promise](docs/rules/valid-expect-with-promise.md) | Require that `resolve` and `reject` modifiers are present (and only) for promise-like types |     |     |     |     |\n\n\u003c!-- end auto-generated rules list --\u003e\n\nIn order to use the rules powered by TypeScript type-checking, you must be using\n`@typescript-eslint/parser` \u0026 adjust your eslint config as outlined\n[here](https://typescript-eslint.io/linting/typed-linting).\n\nNote that unlike the type-checking rules in `@typescript-eslint/eslint-plugin`,\nthe rules here will fallback to doing nothing if type information is not\navailable, meaning it's safe to include them in shared configs that could be\nused on JavaScript and TypeScript projects.\n\nAlso note that `unbound-method` depends on `@typescript-eslint/eslint-plugin`,\nas it extends the original `unbound-method` rule from that plugin.\n\n## Credit\n\n- [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha)\n- [eslint-plugin-jasmine](https://github.com/tlvince/eslint-plugin-jasmine)\n\n## Related Projects\n\n### eslint-plugin-jest-extended\n\nThis is a sister plugin to `eslint-plugin-jest` that provides support for the\nmatchers provided by\n[`jest-extended`](https://github.com/jest-community/jest-extended).\n\n\u003chttps://github.com/jest-community/eslint-plugin-jest-extended\u003e\n\n### eslint-plugin-jest-formatting\n\nThis project aims to provide formatting rules (auto-fixable where possible) to\nensure consistency and readability in jest test suites.\n\n\u003chttps://github.com/dangreenisrael/eslint-plugin-jest-formatting\u003e\n\n### eslint-plugin-istanbul\n\nA set of rules to enforce good practices for Istanbul, one of the code coverage\ntools used by Jest.\n\n\u003chttps://github.com/istanbuljs/eslint-plugin-istanbul\u003e\n\n[`no-deprecated-functions`]: docs/rules/no-deprecated-functions.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjest-community%2Feslint-plugin-jest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjest-community%2Feslint-plugin-jest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjest-community%2Feslint-plugin-jest/lists"}