eslint-plugin-chai-friendly
This plugin overrides no-unused-expressions
to make it friendly towards chai expect statements.
expect(foo).to.be.true;
expect(foo).to.be.true;
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-chai-friendly
:
$ npm install eslint-plugin-chai-friendly --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-chai-friendly
globally.
Usage
Add chai-friendly
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"chai-friendly"
]
}
Then disable original no-unused-expressions
rule and configure chai-friendly replacement under the rules section.
{
"rules": {
"no-unused-expressions": 0,
"chai-friendly/no-unused-expressions": 2
}
}
Supported Rules
- chai-friendly/no-unused-expressions