Odoo: Use Javascript Standard Style (http://standardjs.com)

Created on 11 Mar 2017  Â·  3Comments  Â·  Source: odoo/odoo

I think a good improvement to Odoo's client side Javascript framework would be to use Standard Style

http://standardjs.com/

The most interesting part of this standard in my Opinion is:

* No semicolons – It's fine. Really!
* Never start a line with (, [, or `
  This is the only gotcha with omitting semicolons – automatically checked for you!
  More details

This is more in line with Python's syntax and is easier for new people to grasp. Hope this can be embraced in version 11, together with the Javascript framework upgrade.

Thanks!

Most helpful comment

I personally like standardjs, I used it for some personal projects, but it is pretty much out of the question for Odoo, sorry. It does not bring enough value to justify the cost of switching.

However, we have new coding guidelines, and are moving toward a more classical javascript style: variables are camelcased is the big change. Also, a (soft) limit for the text width at 80 characters. Yes, I know, we could have chosen standardjs, but it is too late now.

All 3 comments

Hi @tebanep,

Thank you for your report. Please also have a look at https://github.com/OCA/web/issues/562#issuecomment-282237551 where @ged-odoo explains all the new features and changes that are coming.
@ged-odoo perhaps you can give feedback & your opinion here? Shall we label this wishlist or is this out of the question? (I'm guessing for the second).

I personally like standardjs, I used it for some personal projects, but it is pretty much out of the question for Odoo, sorry. It does not bring enough value to justify the cost of switching.

However, we have new coding guidelines, and are moving toward a more classical javascript style: variables are camelcased is the big change. Also, a (soft) limit for the text width at 80 characters. Yes, I know, we could have chosen standardjs, but it is too late now.

Ok guys. Thanks for your feedback!

Was this page helpful?
0 / 5 - 0 ratings