Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript Style #37

Closed
Tardo opened this issue Feb 3, 2019 · 12 comments
Closed

Javascript Style #37

Tardo opened this issue Feb 3, 2019 · 12 comments

Comments

@Tardo
Copy link
Member

Tardo commented Feb 3, 2019

Current guidelines are scarce: https://www.odoo.com/documentation/11.0/reference/guidelines.html#javascript-coding-guidelines

What do you think about using Javascript Standard or Semi-Standard Style?

More Info: https://standardjs.com/

@elicoidal
Copy link
Contributor

I would be in favor but looks like a big leap for the OCA.
To be said that we do not have that many lines in jscript in OCA.

@pedrobaeza
Copy link
Member

@yajo

@yajo
Copy link
Member

yajo commented Feb 4, 2019

I like it. However, basically every line of JS code will violate that standard in OCA, so I don't think it's practical as of today. I don't feel like @elicoidal... 😏

ESLint also offers an additional benefit of being able to catch ES6+ code, which should be forbidden for all Odoo code as of today (see OCA/maintainer-tools#383). In v8-11 versions this saves a lot of hard debugging time with PhantomJS tests breaking the world.

I think that a simple note in the docs that directs to our current ESLint config, which is currently quite hidden, and tells the developer to just install eslint and apply that configuration to know if his code is OK would be better.

Let me ping @OCA/web-maintainers @OCA/website-maintainers @OCA/e-commerce-maintainers.

@Tardo
Copy link
Member Author

Tardo commented Feb 4, 2019

@yajo Thanks for ESLint config link!
Surprised that Odoo 13 supports IE11 (https://html5test.com/compare/browser/ie-11/chrome-68/firefox-60/edge-18.html) :S but it's understandable (https://www.netmarketshare.com/browser-market-share.aspx)...

@pedrobaeza
Copy link
Member

Odoo 13 is not going to support it officially AFAIK. Odoo 12 does.

@simahawk
Copy link
Contributor

simahawk commented Feb 5, 2019

I think that a simple note in the docs that directs to our current ESLint config, which is currently quite hidden, and tells the developer to just install eslint and apply that configuration to know if his code is OK would be better.

👍 and we may want to update the JS here https://github.com/OCA/maintainer-tools/tree/master/template/module/static/src/js and add a special README/reference on recommended ways to deal w/ JS.

@elicoidal
Copy link
Contributor

I like it. However, basically every line of JS code will violate that standard in OCA, so I don't think it's practical as of today. I don't feel like @elicoidal

looks like we agree no? @yajo 👅

@yajo
Copy link
Member

yajo commented Feb 5, 2019

looks like we agree no? @yajo tongue

Yes! I was telling about this part: "we do not have that many lines in jscript in OCA". I feel we have a lot of them! Only that! 😉

Odoo 13 is not going to support it officially AFAIK. Odoo 12 does.

Let me refresh your memory: 😋 OCA/maintainer-tools#383 (comment)

@pedrobaeza
Copy link
Member

Let me refresh your memory

Ouch, that hurts! IE11 still...

OK, then it will be Odoo 14 when we will be able to standardize JS guidelines.

@Tardo
Copy link
Member Author

Tardo commented Mar 7, 2019

odoo/odoo#28457 (comment)

Information about the standards allowed in v13.0:~

  • Production Code: ES5 (2009 - IE11 Support). Can use modern Promise (ES6: Mostly adopted by browsers)
  • Test Code: ES8 (2017)

Since Odoo 13.0 ES6 is supported: https://www.odoo.com/documentation/13.0/administration/install/deploy.html#supported-browsers

@fredanergi00
Copy link

Hello guys, would like you to help me how to use datatable on odoo, please

moylop260 added a commit to vauxoo-dev/maintainer-quality-tools that referenced this issue Jan 18, 2022
Set ecmaVersion 2020

Avoid error

    Parsing error: Unexpected token >

More info:
 - OCA/odoo-community.org#37 (comment)
moylop260 added a commit to Vauxoo/maintainer-quality-tools that referenced this issue Jan 18, 2022
Set ecmaVersion 2020

Avoid error

    Parsing error: Unexpected token >

More info:
 - OCA/odoo-community.org#37 (comment)
@droobtd
Copy link

droobtd commented May 15, 2024

where addond directory im my repo psae-droob-of-continent-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants