mozillabrasil / sumo_live_helper

Helper Add-on for SUMO forum contributors
https://addons.mozilla.org/firefox/addon/sumo-live-helper-/
Mozilla Public License 2.0
7 stars 8 forks source link

Document it with JSDoc #101

Closed WesleyBranton closed 4 years ago

WesleyBranton commented 4 years ago

Our Javascript code has become quite messy and can be hard to understand in places. I want to document it using JSDoc. I'd also like to make some changes to variable names or code order to make it a little easier to understand what's going on.

The benefit to using JSDoc is that (depending on the code editor that you are using), it has some useful features that will make changes easier to implement.

I would like to do this (since I wrote much of the Javascript code), but after #86 is closed.

dannycolin commented 4 years ago

I'd also like to make some changes to variable names or code order to make it a little easier to understand what's going on.

I was waiting for #58 to be done and release before opening a similar issue. But since you did it, what would you think if we implement a coding style guide? It should also help to make the code cleaner. :)

WesleyBranton commented 4 years ago

I wouldn't be opposed to it. It's potentially a lot of work to do that and it would be pretty low priority.

I've always tried to stick with Google's Style Guides where possible. The only thing I hate about their style guide (and others as well) is the indentation size variation between CSS/HTML (2 spaces) and Javascript (4 spaces). I've always used 4 spaces for all code instead of changing, since it's annoying to keep changing the indentation size on my code editor. Also, most automated tools like Beautify for Brackets convert it all to standard 4 spaces anyway.

At the moment, once the sidebar is implemented, I'd like to go through the code and reorder it, modify variable names and add minimal JSDoc documentation (for functions mostly) just to make it understandable. After that's completed, if we can decide on a good style guide to follow, I wouldn't be opposed to it.

All of this can be done after the extension is updated on AMO though, since it's all back-end stuff.

WesleyBranton commented 4 years ago

@dannycolin I finished what I wanted to do with the code and merged into master. If you have any code cleaning that you wanted to do, feel free.

dannycolin commented 4 years ago

If you have any code cleaning that you wanted to do, feel free.

I'm good for now.

After that's completed, if we can decide on a good style guide to follow, I wouldn't be opposed to it.

I'll open a separated issue so we can close that one and push a new version to AMO.