clutchski/coffeelint

add rule that if(!foo) should be replaced with unless

Open

#381 建立於 2015年2月18日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)CoffeeScript (1,203 star) (169 fork)batch import
Help Wantednew rule

描述

basically - if you have an if block with no else, and you have if not or if !blah, it should be replaced with unless.

if !user
    return res.badRequest ...

should become

unless user
    return res.badRequest..

貢獻者指南