jquery / contribute.jquery.org

Developer documentation common to jQuery projects
https://contribute.jquery.org
Other
25 stars 76 forks source link

JS styleguide: Replacement for onevar #128

Open jzaefferer opened 9 years ago

jzaefferer commented 9 years ago

As @timmywil commented on https://github.com/jquery/contribute.jquery.org/pull/105#issuecomment-134393037:

We need a replacement for this and I think it should be for all projects. I'd like to be able to enforce some value for http://jscs.info/rule/requireMultipleVarDecl.html or http://jscs.info/rule/disallowMultipleVarDecl.html and that should probably be included in the jquery preset.

Airbnb has decent rules for variables: https://github.com/airbnb/javascript/tree/master/es5#variables ES6 variant: https://github.com/airbnb/javascript#variables

Are there other references we should consider? @timmywil would you be willing to put a draft together?

arthurvr commented 9 years ago

I'd personally prefer to put on the disallowMultipleVarDecl option :+1: