Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-21 Thread Joaquin Oltra Hernandez
; > >> >> > And fortunately, jscs actually plans to ship an "autofixer" utility >> that >> >> > will correct violations from within jscs itself. Using the solid >> parser >> >> > and >> >> > tokeniser that jscs is known fo

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-21 Thread Ryan Kaldari
fig > >> > we > >> > do have, won't have to be duplicated. > >> > > >> > The jQuery Team also supports this effort for their various javascript > >> > projects (both as style checker, as we do already, and as

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-21 Thread Jon Robson
s effort for their various javascript >> > projects (both as style checker, as we do already, and as code >> > formatter). >> > So that's a major player we'll have on our side when it comes to >> > continued >> > support for the tool. >

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-21 Thread Ryan Kaldari
t for the tool. > > > > https://github.com/jscs-dev/node-jscs/issues/516 > > > > Supported by Mike Sherov (mikesherov) and Oleg Gaidarenko (markelog), > from > > the jQuery Team (who are also jscs collaborators). And Marat Dulin > > (mdevils), founder of jscs.

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-21 Thread Jon Robson
gt; > — Krinkle > > [1] https://github.com/millermedeiros/esformatter > > On 20 Nov 2014, at 23:57, Derk-Jan Hartman wrote: > > Begin forwarded message: > > Date: 20 november 2014 21:19:24 CET > From: Jon Robson > To: Bahodir Mansurov > Cc: mobile-l > Subject

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-21 Thread Joaquin Oltra Hernandez
I think the most important thing to clarify would be the brackets w/ spaces thing. I'm personally fine with whatever it is that is tool supported (without spaces will need a pull request to js-beautify). Other than that it looks ready to go. Also about the tooling infrastructure, we need: - A

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-21 Thread Joaquin Oltra Hernandez
About if statements boolean conditions, note that JS beautify beautifies properly all of them: if ( true || ( false || true ) && ( true && false ) ) { console.log( true ); } if ( true || ( false || true ) && ( true && false ) ) { console.log( true ); } if ( true ||

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-20 Thread Bahodir Mansurov
Do you know why there are spaces inside () but not inside []. Just curious. > On Nov 20, 2014, at 7:07 PM, Max Semenik wrote: > > Spaces inside of () is the MW convention, inside of [] they're indeed > unneeded. > > On Thu, Nov 20, 2014 at 4:03 PM, Bahodir Mansurov

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-20 Thread Max Semenik
Spaces inside of () is the MW convention, inside of [] they're indeed unneeded. On Thu, Nov 20, 2014 at 4:03 PM, Bahodir Mansurov wrote: > I honestly think that we should do away with spaces inside () and []. It > puts an end to ugly code like this: > > if ( $viewportMeta[ 0 ] && ( isIPhone4 ||

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-20 Thread Bahodir Mansurov
I honestly think that we should do away with spaces inside () and []. It puts an end to ugly code like this: if ( $viewportMeta[ 0 ] && ( isIPhone4 || isIPhone5 ) ) { compare with this (so much nicer) if ($viewportMeta[0] && (isIPhone4 || isIPhone5)) { By removing space we are no longer stressi

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-20 Thread Jon Robson
Follow up If I run `make jsbeautify` now then https://gist.github.com/jdlrobson/a05ddad00175ebceac68 is the result. Outstanding actions: * Need input on rest of the team about which of delete this.cache[title]; or delete this.cache[ title ]; is the preferred standard. * You'll notice jsbeautify an

Re: [WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-18 Thread Bahodir Mansurov
As for # Rule 4, it makes sense to add spaces inside square brackets. The reasoning is the same as why we add spaces inside parenthesis. > On Nov 18, 2014, at 12:28 PM, Jon Robson wrote: > > I explored running jsbeautify [1] on the MobileFrontend codebase and > looked at how the output differs

[WikimediaMobile] Using jsbeautify in MobileFrontend

2014-11-18 Thread Jon Robson
I explored running jsbeautify [1] on the MobileFrontend codebase and looked at how the output differs from the current styling. It introduces various rules that MobileFrontend is currently not adhering too. MobileFrontend already uses jscs [2] so we want to make sure the outputs of both are compati