JavaScript Style Guide

For Angular we are already using this style guide (for which I’ve create this eslint config). We should publish this as a package on npm and include it with the generator if the user chooses to install Angular as a dependency.

For plain JavaScript I was considering asking for suggestions and then creating a poll, but in an attempt to avoid groupthink, I’m going to propose that we use the Airbnb style guide. This guide well reasoned and is currently actively maintained and widely used.

Also, it includes packages, which make it easy to use and to override specific rules if we don’t like them.

If anyone has any objections, let’s discuss them here.

1 Like

We should standardize on airbnb’s style guide (I’m gonna work on bringing dashboard’s codebase in line with it) – as well as post GSoC, migrating us away from ES5.

1 Like

From peeking at the airbnb style guide I think that some of its recommendations require ES6. Is that correct, and is that something we want?

I guess that for OWAs that we start writing now, the answer can be yes, but that implies it would be difficult to apply this to our existing javascript codebase, e.g. in the uicommons module.

They do have an ES5 version and legacy package.

1 Like

I found this eslint plugin that implements the Angular style guide we are using. I’ll add it to the concept dictionary OWA so we can try it out.


I took the liberty of documenting (my proposal for) the style recommendations on this wiki page. Everyone is free to edit the page or discuss here.

1 Like