Skip to content

JS 规范(TS 规范)

注释规范

大模块

js
// ====================
// 模块用途
// ====================

小模块

js
// 模块用途

函数注释

js
/**
 * 函数用途
 * @param {String} param1 参数1
 * @param {String} param2 参数2
 * @returns {String} 返回值
 */

命名规范[命名规范]

引号

使用单引号 ' 代替双引号 "

js
// bad
const name = "John Doe";

// good
const name = "John Doe";

Released under the MIT License.