coffeelint-no-chai-getters
Version:
Coffeelint rule that detects code using a chai getter without function invocation
40 lines (31 loc) • 1.03 kB
Markdown
Coffeelint rule that detects code using a chai getter without function invocation. This is useful for
codebases moving off the chai matcher getter syntax, and using dirty-chai.
Eg:
```js
expect(someDopeSpy).ok
```
This is dangerous, as if it's spelled incorrectly it will fail silently. This is why we prefer the function
invocation syntax provided by dirty-chai
https://www.npmjs.com/package/dirty-chai
The only problem with dirty-chai is that now the getter syntax will fail silently. So, this linter aims to
warn against the use of the old getter syntax.
## Installation
Add the following to your package.json file:
```json
"devDependencies" : {
...
"coffeelint-no-chai-getters": "git://github.com/benchling/coffeelint-no-chai-getters.git#master",
...
}
```
Add the following configuration to coffeelint.json:
```json
"no_chai_getters": {
"module": "coffeelint-no-chai-getters",
"level": "error",
},
```
There are currently no configuration options.