ESLint plugin that checks for common chai.js expect() mistakes
npm install eslint-plugin-chai-expect
Add a plugins section and specify chai-expect as a plugin:
{
"plugins": [
"chai-expect"
]
}Enable the rules that you would like to use:
{
"rules": {
"chai-expect/missing-assertion": 2,
"chai-expect/terminating-properties": 1
}
}no-inner-compare- Prevent using comparisons in theexpect()argumentmissing-assertion- Prevent callingexpect(...)without an assertion like.to.be.okterminating-properties- Prevent callingto.be.okand other assertion properties as functionsno-invalid-terminating-properties- Prevent using invalid terminating properties such asto.be.falsyorto.be.truthy
eslint-plugin-chai-expect is licensed under the MIT License.