ailabstw / pttai.js

Official web frontend of the Ptt.ai Framework
https://ptt.ai
GNU General Public License v3.0
7 stars 3 forks source link

coding style guide #90

Open wildskyf opened 5 years ago

wildskyf commented 5 years ago

ref: https://google.github.io/styleguide/jsguide.html

wildskyf commented 5 years ago

ref: https://editorconfig.org

wildskyf commented 5 years ago

no semicolon, but If there is a line start with () or [] (also, regex, +, - ), we add a semicolon in the beginning of the line.

ref: https://www.zhihu.com/question/20298345/answer/49551142

we could also use https://github.com/yyx990803/semi and git pre-commit hook to ensure we have same coding style.

poga commented 5 years ago

https://standardjs.com/ this is my favorite :D.

It also provides a formatter to fix style automatically for you.