{"id":13492959,"url":"https://github.com/levibuzolic/eslint-plugin-no-only-tests","last_synced_at":"2025-05-15T10:01:58.992Z","repository":{"id":4098137,"uuid":"51976302","full_name":"levibuzolic/eslint-plugin-no-only-tests","owner":"levibuzolic","description":"ESLint rule for catching focused/only test blocks","archived":false,"fork":false,"pushed_at":"2025-02-04T02:45:01.000Z","size":182,"stargazers_count":94,"open_issues_count":2,"forks_count":19,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-14T01:30:12.874Z","etag":null,"topics":["eslint","eslint-plugin","eslint-rules","jasmine","jest","mocha"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-plugin-no-only-tests","language":"JavaScript","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/levibuzolic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2016-02-18T03:34:39.000Z","updated_at":"2025-04-09T10:10:58.000Z","dependencies_parsed_at":"2025-02-08T02:04:30.198Z","dependency_job_id":"0fd9daf8-3646-43d0-acb2-00d6923c431c","html_url":"https://github.com/levibuzolic/eslint-plugin-no-only-tests","commit_stats":{"total_commits":95,"total_committers":12,"mean_commits":7.916666666666667,"dds":"0.18947368421052635","last_synced_commit":"ffda178dcbb576ec5d37ce6c48d56729048319e1"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levibuzolic%2Feslint-plugin-no-only-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levibuzolic%2Feslint-plugin-no-only-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levibuzolic%2Feslint-plugin-no-only-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levibuzolic%2Feslint-plugin-no-only-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levibuzolic","download_url":"https://codeload.github.com/levibuzolic/eslint-plugin-no-only-tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319717,"owners_count":22051072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","eslint-rules","jasmine","jest","mocha"],"created_at":"2024-07-31T19:01:10.845Z","updated_at":"2025-05-15T10:01:58.197Z","avatar_url":"https://github.com/levibuzolic.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# eslint-plugin-no-only-tests\n\n[![Version](https://img.shields.io/npm/v/eslint-plugin-no-only-tests.svg)](https://www.npmjs.com/package/eslint-plugin-no-only-tests) [![Downloads](https://img.shields.io/npm/dm/eslint-plugin-no-only-tests.svg)](https://npmcharts.com/compare/eslint-plugin-no-only-tests?minimal=true) [![GitHub Tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests/workflows/Tests/badge.svg)](https://github.com/levibuzolic/eslint-plugin-no-only-tests/actions?query=workflow%3ATests)\n\nESLint rule for `.only` tests in [Mocha](https://mochajs.org/), [Jest](https://jestjs.io/), [Jasmine](https://jasmine.github.io/), [Mocha Cakes 2](https://github.com/iensu/mocha-cakes-2) and other JS testing libraries.\n\nThe following test blocks are matched by default: `describe`, `it`, `context`, `tape`, `test`, `fixture`, `serial`, `Feature`, `Scenario`, `Given`, `And`, `When` and `Then`.\n\nDesigned to prevent you from committing focused (`.only`) tests to CI, which may prevent your entire test suite from running.\n\nIf the testing framework you use doesn't use `.only` to focus tests, you can override the matchers with [options](#options).\n\n## Installation\n\n[Install ESLint](https://eslint.org/docs/user-guide/getting-started) if you haven't done so already, then install `eslint-plugin-no-only-tests`:\n\n```bash\nnpm install --save-dev eslint-plugin-no-only-tests\n# or\nyarn add --dev eslint-plugin-no-only-tests\n```\n\n\u003e **Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-no-only-tests` globally.\n\n## Usage\n\nAdd `no-only-tests` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:\n\n```json\n\"plugins\": [\n  \"no-only-tests\"\n]\n```\n\nThen add the rule to the rules section of your `.eslintrc`:\n\n```json\n\"rules\": {\n  \"no-only-tests/no-only-tests\": \"error\"\n}\n```\n\nIf you use a testing framework that uses a test block name that isn't present in the [defaults](#options), or a different way of focusing test (something other than `.only`) you can specify an array of blocks and focus methods to match in the options.\n\n```json\n\"rules\": {\n  \"no-only-tests/no-only-tests\": [\n    \"error\", {\n      \"block\": [\"test\", \"it\", \"assert\"],\n      \"focus\": [\"only\", \"focus\"]\n    }\n  ]\n}\n```\n\nThe above example will catch any uses of `test.only`, `test.focus`, `it.only`, `it.focus`, `assert.only` and `assert.focus`.\n\nThis rule supports opt-in autofixing when the `fix` option is set to `true` to avoid changing runtime code unintentionally when configured in an editor.\n\n```json\n\"rules\": {\n  \"no-only-tests/no-only-tests\": [\"error\", {\"fix\": true}]\n}\n```\n\n## Options\n\n| Option      | Type       | Description                                                                                                                                                                                                                                                                                                   |\n| ----------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `block`     | `string[]` | Specify the block names that your testing framework uses. Add a `*` to the end of any string to enable prefix matching (ie. `test*` will match `testExample.only`)\u003cbr\u003eDefaults to `[\"describe\", \"it\", \"context\", \"test\", \"tape\", \"fixture\", \"serial\", \"Feature\", \"Scenario\", \"Given\", \"And\", \"When\", \"Then\"]` |\n| `focus`     | `string[]` | Specify the focus scope that your testing framework uses.\u003cbr\u003eDefaults to `[\"only\"]`                                                                                                                                                                                                                           |\n| `functions` | `string[]` | Specify not permitted functions. Good examples are `fit` or `xit`.\u003cbr\u003eDefaults to `[]` (disabled)                                                                                                                                                                                                             |\n| `fix`       | `boolean`  | Enable this rule to auto-fix violations, useful for a pre-commit hook, not recommended for users with auto-fixing enabled in their editor.\u003cbr\u003eDefaults to `false`                                                                                                                                             |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevibuzolic%2Feslint-plugin-no-only-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevibuzolic%2Feslint-plugin-no-only-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevibuzolic%2Feslint-plugin-no-only-tests/lists"}