jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

requireCurlyBraces for throw statement doesn't work well #2189

Closed gemyago closed 8 years ago

gemyago commented 8 years ago

Hi,

The rule like this:

    "requireCurlyBraces" : {
        "keywords" : ["if"],
        "allExcept" : ["return", "throw"]
    }

Will allow this: if (true) return 'Hello';

But not this: if (true) throw new Error('Hello');

Environment:

node --version
v0.12.9

jscs --version
2.11.0

uname -a
Linux pc-em 3.19.0-49-generic #55~14.04.1-Ubuntu SMP Fri Jan 22 11:24:31 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
markelog commented 8 years ago

At this point only major and CST related bugs will be fixed.