Nice way to get rid of no-unused-expressions linter error with chai

后端 未结 6 1776
长发绾君心
长发绾君心 2020-12-09 07:12

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

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 07:57

    I've made a small plugin called eslint-plugin-chai-friendly that overrides the default no-unused-expressions rule and makes it friendly towards chai. The modified rule ignores the expect and should statements while keeping default behavior for everything else.

提交回复
热议问题