{"id":13801876,"url":"https://github.com/ihordiachenko/eslint-plugin-chai-friendly","last_synced_at":"2025-04-04T19:15:02.599Z","repository":{"id":13766331,"uuid":"74901199","full_name":"ihordiachenko/eslint-plugin-chai-friendly","owner":"ihordiachenko","description":"Makes eslint friendly towards Chai.js 'expect' and 'should' statements.","archived":false,"fork":false,"pushed_at":"2024-08-25T21:34:42.000Z","size":207,"stargazers_count":53,"open_issues_count":6,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T17:31:08.046Z","etag":null,"topics":["chai","eslint","eslint-plugin","javascript","linting","unit-testing"],"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/ihordiachenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-11-27T16:55:04.000Z","updated_at":"2024-09-17T13:59:41.000Z","dependencies_parsed_at":"2024-05-20T00:26:51.441Z","dependency_job_id":"a906071f-ea59-4cae-8e96-3741e899023a","html_url":"https://github.com/ihordiachenko/eslint-plugin-chai-friendly","commit_stats":{"total_commits":66,"total_committers":8,"mean_commits":8.25,"dds":0.6818181818181819,"last_synced_commit":"6303aa50b9eefaf63b7b28edc7bfba5ebb964e2b"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihordiachenko%2Feslint-plugin-chai-friendly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihordiachenko%2Feslint-plugin-chai-friendly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihordiachenko%2Feslint-plugin-chai-friendly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihordiachenko%2Feslint-plugin-chai-friendly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ihordiachenko","download_url":"https://codeload.github.com/ihordiachenko/eslint-plugin-chai-friendly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234923,"owners_count":20905854,"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":["chai","eslint","eslint-plugin","javascript","linting","unit-testing"],"created_at":"2024-08-04T00:01:29.099Z","updated_at":"2025-04-04T19:15:02.576Z","avatar_url":"https://github.com/ihordiachenko.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Testing Tools"],"readme":"# eslint-plugin-chai-friendly\n\n[![npm](https://img.shields.io/npm/v/eslint-plugin-chai-friendly.svg)](https://www.npmjs.com/package/eslint-plugin-chai-friendly) [![npm](https://img.shields.io/npm/dm/eslint-plugin-chai-friendly)](https://www.npmjs.com/package/eslint-plugin-chai-friendly)\n\nThis plugin overrides `no-unused-expressions` to make it friendly towards chai `expect` and `should` statements.\n\n```javascript\n// this\nexpect(foo).to.be.true;\nfoo.should.be.true;\n\n// instead of this\nexpect(foo).to.be.true; // eslint-disable-line no-unused-expressions\nfoo.should.be.true; // eslint-disable-line no-unused-expressions\n```\n\n## Installation\n\nYou'll first need to install [ESLint](http://eslint.org):\n\n```bash\nnpm i eslint --save-dev\n```\n\nNext, install `eslint-plugin-chai-friendly`:\n\n```bash\nnpm install eslint-plugin-chai-friendly --save-dev\n```\n\n**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-chai-friendly` globally.\n\n## Usage\n\nAdd `chai-friendly` to the plugins section of your  ESLint configuration file. Then disable original `no-unused-expressions` rule and configure chai-friendly replacement under the rules section.\n\nESLint 9 flat config format:\n\n```js\nimport pluginChaiFriendly from 'eslint-plugin-chai-friendly';\n\nexport default {\n    plugins: {'chai-friendly': pluginChaiFriendly},\n    rules: {\n        \"no-unused-expressions\": \"off\", // disable original rule\n        \"chai-friendly/no-unused-expressions\": \"error\"\n    },\n};\n```\n\nLegacy `.eslintrc` format:\n\n```json\n{\n    \"plugins\": [\n        \"chai-friendly\" // you can omit the eslint-plugin- prefix\n    ],\n    \"rules\": {\n        \"no-unused-expressions\": 0, // disable original rule\n        \"chai-friendly/no-unused-expressions\": 2\n    }\n}\n```\n\nIf you don't need to tweak the above rule settings, you can instead\nextend the provided recommended configuration.\n\nESLint 9 flat config format:\n\n```js\nconst pluginChaiFriendly = require(\"eslint-plugin-chai-friendly\");\n\nmodule.exports = [\n    pluginChaiFriendly.configs.recommendedFlat,\n    // other configurations\n]\n```\n\nLegacy `.eslintrc` format:\n\n\n```json\n{\n  \"extends\": [\"plugin:chai-friendly/recommended\"]\n}\n```\n\n## Options\n\nThis rule, in its default state, does not require any arguments. If you would like to enable one or more of the following you may pass an object with the options set as follows:\n\n- `allowShortCircuit` set to `true` will allow you to use short circuit evaluations in your expressions (Default: `false`).\n- `allowTernary` set to `true` will enable you to use ternary operators in your expressions similarly to short circuit evaluations (Default: `false`).\n- `allowTaggedTemplates` set to `true` will enable you to use tagged template literals in your expressions (Default: `false`).\n- `enforceForJSX` set to `true` will flag unused JSX element expressions (Default: `false`).\n\nThese options allow unused expressions only if all of the code paths either directly change the state (for example, assignment statement) or could have side effects (for example, function call).\n\nMore info in the original rule's [docs](http://eslint.org/docs/rules/no-unused-expressions#options).\n\n## Supported Rules\n\n- `chai-friendly/no-unused-expressions`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihordiachenko%2Feslint-plugin-chai-friendly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fihordiachenko%2Feslint-plugin-chai-friendly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihordiachenko%2Feslint-plugin-chai-friendly/lists"}