In my Chai tests I often find myself wanting to use their assertions that are something like .to.be.empty
, .to.be.true
e.t.c., because I find them
I had this issue with tslint and solved it by simply moving the rule for unused expressions down one level. My ./tslint.json
has all the other rules I care about, then I made ./src/tslint.json
that just looks like
{
"rules": {
"no-unused-expression": true
},
"extends": "../tslint.json"
}
tslint automatically checks for a config file in every level as it descends the tree (with --project
or using the VSCode extension) so this means that my tests (under ./test/
) have all the other rules applied, but no-unused-expression
only applies to files under ./src/
.