Google's Javascript Style Guide

12 views
Skip to first unread message

Łukasz Lewczyński

unread,
Mar 16, 2018, 4:03:09 AM3/16/18
to OpenLMIS Dev, Nikodem Graczewski
Hi,

On our last Sprint Retrospective we decided that we should add something like checktyle/pmd validation to our JavaScript code because code is not consistent and sometimes we need to adjust code because of review comments.

I checked and found that there is the Google guide for JS code and I think because we implement similar guide for Java we could use this one for JS code. Below you can find useful links.

Google javaScript Guide

Eslint configuration:

Any thoughts?

Regards,
Lukasz

Łukasz Lewczyński
Software Developer
llewc...@soldevelo.com


SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

Brandon Bowersox-Johnson

unread,
Mar 16, 2018, 12:35:32 PM3/16/18
to OpenLMIS Dev

Thanks for bringing this up. Our current JavaScript Coding Conventions are here: http://docs.openlmis.org/en/latest/conventions/uiJavascript.html

 

Is the Google JavaScript Guide you are proposing compatible with our existing conventions? In other words, is the Google JavaScript Guide just an addition to our current conventions? Or does your proposal involve changing what we already have?

 

-Brandon

 

From: <openlm...@googlegroups.com> on behalf of Łukasz Lewczyński <llewc...@soldevelo.com>
Date: Friday, March 16, 2018 at 1:03 AM
To: OpenLMIS Dev <openlm...@googlegroups.com>, Nikodem Graczewski <ngrac...@soldevelo.com>
Subject: [openlmis-dev] Google's Javascript Style Guide

 

Hi,

 

On our last Sprint Retrospective we decided that we should add something like checktyle/pmd validation to our JavaScript code because code is not consistent and sometimes we need to adjust code because of review comments.

 

I checked and found that there is the Google guide for JS code and I think because we implement similar guide for Java we could use this one for JS code. Below you can find useful links.

 

Google javaScript Guide

 

Eslint configuration:

 

Any thoughts?

 

Regards,

Lukasz

 

Łukasz Lewczyński
Software Developer
llewc...@soldevelo.com


http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com


Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
openlmis-dev...@googlegroups.com.
To post to this group, send email to
openlm...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/openlmis-dev/CAAdp53wwwcnB7i0kVV%2B6BWxNJCtP1O1avU6jTXejD9ni4U5WuQ%40mail.gmail.com.
For more options, visit
https://groups.google.com/d/optout.

Paweł Albecki

unread,
Mar 20, 2018, 10:48:37 AM3/20/18
to Brandon Bowersox-Johnson, OpenLMIS Dev
Hi Łukasz,

Is Google's Javascript Style Guide compatible with our current tech stack? 

Regards,
Paweł

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.

To post to this group, send email to openlm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Paweł Albecki
Software Developer
palb...@soldevelo.com



SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com

Łukasz Lewczyński

unread,
Mar 20, 2018, 11:18:15 AM3/20/18
to Paweł Albecki, Brandon Bowersox-Johnson, OpenLMIS Dev
Thanks for reply all.

Firstly as someone who daily works with backend code I was surprised (in the positive way) that we have our own coding conventions. I mean I know that we code in some style but I thought it is more like general conventions that are recommended by the JS community. 

I proposed Google Style because we use them for the Java code but I am okay with staying with current approach as long as we will be able to configure some kind of tool similar to checktyle/pmd in the Java to verify that our code match the convention. Currently I see that some issues are found by reviewers like missing/extra space, too small indentations or even that the file has incorrect formatting.

I compared google style with our approach and it seems like there are some differences like number of spaces in indentations.

Regards,
Lukasz


Łukasz Lewczyński
Software Developer
llewc...@soldevelo.com

On Tue, Mar 20, 2018 at 3:48 PM, Paweł Albecki <palb...@soldevelo.com> wrote:
Hi Łukasz,

Is Google's Javascript Style Guide compatible with our current tech stack? 

Regards,
Paweł

For more options, visit https://groups.google.com/d/optout.

Paweł Gesek

unread,
Mar 21, 2018, 10:28:07 AM3/21/18
to OpenLMIS Dev
Two popular linting configurations I know of:

AirBnb:

Netflix:

Perhaps those fit us better than the Google one? Anyway, I completely support adding a linter of some sort, reviewers should not bother with indentation and stuff like that, that's the job of static code analysis. Having to find such things manually negatively impacts the reviews overall.

Regards,
Paweł 


For more options, visit https://groups.google.com/d/optout.



--

Paweł Gesek
Technical Project Manager
pge...@soldevelo.com / +48 690 020 875

Mateusz Kwiatkowski

unread,
Mar 21, 2018, 10:37:38 AM3/21/18
to Łukasz Lewczyński, OpenLMIS Dev
Hi Łukasz,

I think it is a good idea to introduce some check style to the UI. I know that developers are using some linters in their IDEs but they may differ, also as reviewers we are not capable of finding all of those issues as Paweł mentioned, only those easiest to find. I'm only worried how much effort it will take to either configure linter to match our current code or to fix it. 
Since we are already using Sonar maybe we could go with SonarEsLint?
I would vote for creating ticket to do the needed research before start working on it.

Best Regards,
Mateusz


For more options, visit https://groups.google.com/d/optout.

Paweł Gesek

unread,
Mar 21, 2018, 10:50:41 AM3/21/18
to OpenLMIS Dev
Just to mention - the John Papa has a JShint configuration:


From what I recall we are heavily based on this styleguide, correct?

Regards,
Paweł


For more options, visit https://groups.google.com/d/optout.



--

Paweł Gesek
Technical Project Manager
pge...@soldevelo.com / +48 690 020 875

Nikodem Graczewski

unread,
Mar 21, 2018, 10:52:55 AM3/21/18
to Paweł Gesek, OpenLMIS Dev
That's correct, we were basing our coding conventions on John Papa's style guide, but we're starting to drift away from it.

Still, it might be a good idea to use it.

Best regards,
Nikodem

Nikodem Graczewski
Software Developer


For more options, visit https://groups.google.com/d/optout.

Brandon Bowersox-Johnson

unread,
Mar 21, 2018, 2:06:16 PM3/21/18
to OpenLMIS Dev

I support the idea of making a ticket to research JavaScript linters for our Sonar. If there is a linter configuration that enforces our current John Papa coding conventions, that would be best from my perspective. I know Nick was a supporter of the John Papa conventions; just because Nick left the project is not a good reason to change our convention and re-format all of our JavaScript codebase. So automating the checking to enforce our current conventions feels like the right thing for us to do.

 

-Brandon


Error! Filename not specified.


SolDevelo
Sp. z o.o. [LLC] /


Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone:
+48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit


For more options, visit
https://groups.google.com/d/optout.

--

Paweł Albecki
Software Developer
palb...@soldevelo.com


Error! Filename not specified.


SolDevelo
Sp. z o.o. [LLC] /


Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit


For more options, visit
https://groups.google.com/d/optout.

http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.


To post to this group, send email to

--

Paweł Gesek
Technical Project Manager
pge...@soldevelo.com / +48 690 020 875

http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.


To post to this group, send email to

http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit


For more options, visit
https://groups.google.com/d/optout.



 

--

Paweł Gesek
Technical Project Manager
pge...@soldevelo.com / +48 690 020 875

http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.


To post to this group, send email to

http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.


To post to this group, send email to

Łukasz Lewczyński

unread,
Mar 22, 2018, 9:26:12 AM3/22/18
to Brandon Bowersox-Johnson, OpenLMIS Dev
We have the epic OLMIS-3390 (UI Architecture and dev-ui v7) which have in the description the following ticket:

Add linters to build process
Value: Linters help prevent common syntax mistakes and help enforce code quality

But I don't see the actual ticket so I added one: OLMIS-4388

Regards,
Lukasz


Łukasz Lewczyński
Software Developer
llewc...@soldevelo.com

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit


For more options, visit
https://groups.google.com/d/optout.

--

Paweł Albecki
Software Developer
palb...@soldevelo.com


Error! Filename not specified.
SolDevelo
Sp. z o.o. [LLC] /
www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit


For more options, visit
https://groups.google.com/d/optout.


http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.


To post to this group, send email to

--

Paweł Gesek
Technical Project Manager
pge...@soldevelo.com / +48 690 020 875


http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.


To post to this group, send email to


http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit


For more options, visit
https://groups.google.com/d/optout.



 

--

Paweł Gesek
Technical Project Manager
pge...@soldevelo.com / +48 690 020 875


http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.


To post to this group, send email to


http://www.soldevelo.com/sites/default/files/Soldevelo_logo_EPS_CMYK.png
SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.


To post to this group, send email to


To view this discussion on the web visit

--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.

To post to this group, send email to openlm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



SolDevelo
Sp. z o.o. [LLC] / www.soldevelo.com
Reply all
Reply to author
Forward
0 new messages