Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fintechstudios/eslint-plugin-chai-as-promised
Prevent common problems when using chai-as-promised
https://github.com/fintechstudios/eslint-plugin-chai-as-promised
chai chai-as-promised eslint eslint-plugin eslint-plugin-chai
Last synced: 3 months ago
JSON representation
Prevent common problems when using chai-as-promised
- Host: GitHub
- URL: https://github.com/fintechstudios/eslint-plugin-chai-as-promised
- Owner: fintechstudios
- License: mit
- Created: 2018-09-18T18:04:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-02T23:48:03.000Z (4 months ago)
- Last Synced: 2024-07-07T00:29:49.813Z (4 months ago)
- Topics: chai, chai-as-promised, eslint, eslint-plugin, eslint-plugin-chai
- Language: JavaScript
- Size: 256 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-eslint - with chai-as-promised plugin
README
# @fintechstudios/eslint-plugin-chai-as-promised
Prevent common problems when using chai-as-promised
## Installation
You'll first need to install [ESLint](http://eslint.org):
```
$ npm i eslint --save-dev
```Next, install `@fintechstudios/eslint-plugin-chai-as-promised`:
```
$ npm install @fintechstudios/eslint-plugin-chai-as-promised --save-dev
```**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `@fintechstudios/eslint-plugin-chai-as-promised` globally.
## Usage
Add `@fintechstudios/chai-as-promised` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": [
"@fintechstudios/eslint-plugin-chai-as-promised"
]
}
```Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"@fintechstudios/chai-as-promised/no-unhandled-promises": 2,
"@fintechstudios/chai-as-promised/no-await-in-condition": 2
}
}
```Or, to just use the configuration above as is, you can simply add the
following instead:```json
{
"extends": ["plugin:@fintechstudios/chai-as-promised/recommended"]
}
```## Supported Rules
* [`no-await-in-condition`](./docs/rules/no-await-in-condition.md): Must not use
await within chai-as-promised expressions
* [`no-unhandled-promises`](./docs/rules/no-unhandled-promises.md): Must handle
promises returned from chai-as-promised expressions