lncli-web icon indicating copy to clipboard operation
lncli-web copied to clipboard

Add a style guide

Open PirosB3 opened this issue 7 years ago • 5 comments

It would be great to define a specific style guide to enforce. This would make sure we all have the same expectation when writing code, and we can also take advantage of automated tooling for lint. It looks like Airbnb, GitHub, & Google all have some open source style guide that we can take advantage of, but I don't have experience with any of them.

Would you be interested in enforcing a style guide for the next contributions? if so, do you have a preference?

PirosB3 avatar Sep 23 '18 07:09 PirosB3

Yep definitely, Airbnb seems interesting to me.

mably avatar Sep 23 '18 21:09 mably

Sounds great!

PirosB3 avatar Sep 23 '18 23:09 PirosB3

Sounds great! So I have made a branch containing the tooling and stile documentation using Airbnb JS (https://github.com/PirosB3/lncli-web/tree/lnd-manager-linting). In order to avoid confusion with https://github.com/mably/lncli-web/pull/163, I will wait till that PR gets merged to master and then I will open a subsequent PR containing style fixes

PirosB3 avatar Sep 28 '18 04:09 PirosB3

FYI we are already using jscs for code validation (via `gulp'), let's try not to break everything and be as close as possible as what is already in place, unless it can be improved of course.

mably avatar Sep 28 '18 09:09 mably

Thanks for pointing that out, I actually didn't know that! said this, It looks like JSCS has merged with ESLint (https://www.npmjs.com/package/jscs) and ESLint contains default for Airbnb guide. JSCS website is also gone lol.

I'm opening my PR now so you can take a look at the changes I did, and we can chat more about this on the PR

PirosB3 avatar Sep 28 '18 16:09 PirosB3