lijinma
V2EX  ›  Node.js

大家 nodejs 都使用什么 Code style and code convention?

  •  
  •   lijinma · Mar 8, 2014 · 4474 views
    This topic created in 4622 days ago, the information mentioned may be changed or developed.
    用nodejs一段时间,但是同事之间代码风格不太一致,看起来别扭,我有代码洁癖。。。

    网上查了很多,使用的比较多和推崇的比较多的是:

    Felix's Node.js Style Guide

    http://nodeguide.com/style.html

    (1)大家都用什么code style 和 code convention?

    (2)mongodb数据库的name convention呢?

    (3)view中的html的name convention呢?

    感谢你的答案;
    6 replies  •  1970-01-01 08:00:00 +08:00
    hxgdzyuyi
    hxgdzyuyi
    Mar 8, 2014
    1
    comma first
    hxgdzyuyi
    hxgdzyuyi
    Mar 8, 2014
    2
    tj那种
    leofml
    leofml
    Mar 8, 2014 via iPad
    3
    必须使用promise和lodash,嵌套不能超过三层。
    cnxh
    cnxh
    Mar 8, 2014
    4
    ))}}})))}})))}))
    rexren
    rexren
    Mar 9, 2014
    5
    个人感觉不同style guide都大同小异,重要的是team里有一个大家都认可并且遵守的即可。
    mcfog
    mcfog
    Mar 9, 2014
    6
    如果场景是同事的话,我觉得可执行跟重要,所以选择jsHint,放jshintrc文件,grunt上检查,用机器自动拉代码,发现fail 就发邮件点名 谁的代码fail了

    promise 必须有
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4474 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 01:10 · PVG 09:10 · LAX 17:10 · JFK 20:10
    ♥ Do have faith in what you're doing.