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

requireVarDeclFirst rule doesn't recognize ES6 arrow functions provide a new function scope #2163

Closed kfoisy closed 8 years ago

kfoisy commented 8 years ago

When declaring a variable at the top of an ES6 arrow function, a new scope isn't recognized. The following code gives a "Variable declarations must be the first statements of a function scope." error, when it shouldn't:

() => { var something = 'test'; }

fernandopasik commented 8 years ago

This behaviour is affecting also to requireMultipleVarDecl='onevar', as it says that the declarations should be joined.

ghost commented 8 years ago

@markelog Sad to see JSCS go away. Anyway sorry for being away for so long, I hope to get some time to look back here now that I am done with relocation. Are we still fixing issues that are open.

markelog commented 8 years ago

Works for me