{"id":13801871,"url":"https://github.com/turbo87/eslint-plugin-chai-expect","last_synced_at":"2025-04-12T19:52:24.000Z","repository":{"id":4093206,"uuid":"51959786","full_name":"Turbo87/eslint-plugin-chai-expect","owner":"Turbo87","description":"ESLint plugin that checks for common chai.js expect() mistakes","archived":false,"fork":false,"pushed_at":"2025-04-07T06:28:08.000Z","size":1199,"stargazers_count":27,"open_issues_count":6,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T19:51:49.060Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Turbo87.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}},"created_at":"2016-02-17T22:23:16.000Z","updated_at":"2025-04-07T06:28:10.000Z","dependencies_parsed_at":"2023-11-20T04:25:48.565Z","dependency_job_id":"68b1caf2-73f6-40ca-8169-6efb5361ac2a","html_url":"https://github.com/Turbo87/eslint-plugin-chai-expect","commit_stats":{"total_commits":407,"total_committers":17,"mean_commits":"23.941176470588236","dds":0.4275184275184275,"last_synced_commit":"a36efd6ae40bf156cc7e15898ad00aafef2de72b"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbo87%2Feslint-plugin-chai-expect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbo87%2Feslint-plugin-chai-expect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbo87%2Feslint-plugin-chai-expect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbo87%2Feslint-plugin-chai-expect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Turbo87","download_url":"https://codeload.github.com/Turbo87/eslint-plugin-chai-expect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625505,"owners_count":21135513,"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":[],"created_at":"2024-08-04T00:01:29.022Z","updated_at":"2025-04-12T19:52:23.975Z","avatar_url":"https://github.com/Turbo87.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Testing Tools"],"readme":"# eslint-plugin-chai-expect\n\n[![Build Status](https://img.shields.io/travis/Turbo87/eslint-plugin-chai-expect/master.svg)](https://travis-ci.org/Turbo87/eslint-plugin-chai-expect)\n\nESLint plugin that checks for common chai.js `expect()` mistakes\n\n\u003e [!IMPORTANT]\n\u003e The `recommended` preset is for the ESLint legacy configuration system\n\u003e (`.eslintrc.json`). The `recommended-flat` configuration is for the new flat\n\u003e configuration system.\n\n## Requirements\n\n- Node.js 6 or above\n- ESLint 4.x or 5.x or 6.x\n\n\n## Installation\n\n```\nnpm install --save-dev eslint-plugin-chai-expect\n```\n\n\n## Configuration\n\n### Legacy ESLint Configuration Format (.eslintrc.json)\n\nAdd a `plugins` section and specify `chai-expect` as a plugin:\n\n```json\n{\n  \"plugins\": [\n    \"chai-expect\"\n  ]\n}\n```\n\nEnable the rules that you would like to use:\n\n```json\n{\n  \"rules\": {\n    \"chai-expect/no-inner-compare\": 2,\n    \"chai-expect/no-inner-literal\": 2,\n    \"chai-expect/missing-assertion\": 2,\n    \"chai-expect/terminating-properties\": 2\n  }\n}\n```\n\nOr, if you just want the above defaults, you can avoid all of the above\nand just extend the config:\n\n```json\n{\n  \"extends\": [\"plugin:chai-expect/recommended\"]\n}\n```\n\n### Flat ESLint Configuration Format (eslint.config.js)\n\nAdd a `plugins` section and specify `chai-expect` as a plugin and enable the rules that you would like to use:\n\n```js\nimport chaiExpectPlugin from 'eslint-plugin-chai-expect';\n\nexport default [\n  {\n    \"plugins\": {\n      \"chai-expect\": chaiExpectPlugin\n    },\n    \"rules\": {\n      \"chai-expect/no-inner-compare\": 2,\n      \"chai-expect/no-inner-literal\": 2,\n      \"chai-expect/missing-assertion\": 2,\n      \"chai-expect/terminating-properties\": 2\n    }\n  }\n];\n```\n\nOr, if you just want the above defaults, you can avoid all of the above\nand just extend the config:\n\n```js\nimport chaiExpectPlugin from 'eslint-plugin-chai-expect';\n\nexport default [\n  chaiExpectPlugin.configs[\"recommended-flat\"],\n  {\n    // ...\n  },\n];\n```\n\n## Rules\n\n- `no-inner-compare` - Prevent using comparisons in the `expect()` argument\n- `no-inner-literal` - Prevent using literals in the `expect()` argument\n  (`undefined`, `null`, `NaN`, `(+|-)Infinity`, `this`, booleans, numbers,\n  strings, and BigInt or regex literals)\n- `missing-assertion` - Prevent calling `expect(...)` without an assertion\n  like `.to.be.ok`\n- `terminating-properties` - Prevent calling `to.be.ok` and other assertion\n  properties as functions\n\n\n### Additional configuration\n\n#### terminating-properties rule\n\nA number of extensions to chai add additional terminating properties.  For example [chai-http](https://github.com/chaijs/chai-http) adds:\n\n - headers\n - html\n - ip\n - json\n - redirect\n - text\n\nThe terminating-properties rule can be configured to ensure these (or other) additional properties are not used as functions:\n\n```json\n{\n  \"rules\": {\n    \"chai-expect/terminating-properties\": [\"error\", {\n      \"properties\": [\"headers\", \"html\", \"ip\", \"json\", \"redirect\", \"test\"]\n    }]\n  }\n}\n```\n\n\n## License\n\neslint-plugin-chai-expect is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbo87%2Feslint-plugin-chai-expect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturbo87%2Feslint-plugin-chai-expect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbo87%2Feslint-plugin-chai-expect/lists"}