【发布时间】:2015-08-20 23:31:06
【问题描述】:
所有官方 JSDoc 示例都有非常简单的文档字符串,如下所示:
/**
* @param {string} author - The author of the book.
*/
问题是,在现实生活中的文档中,您通常有更长的文档字符串:
/**
* @param {string} author - The author of the book, presumably some person who writes well
*/
但由于大多数公司(出于合法的可读性原因)都有行长限制,因此上述内容通常是不可接受的。但是,我想不通的是打破这些线条的“正确”方式应该是什么。
我能做到:
/**
* @param {string} author - The author of the book, presumably some
* person who writes well
*/
但这很难阅读。我可以这样做:
/**
* @param {string} author - The author of the book, presumably some
* person who writes well
*/
这看起来更好,但它会导致大量的行,特别是如果参数名称很长:
/**
* @param {string} personWhoIsTheAuthorOfTheBook - The author of the
* book, presumably
* some person who
* writes well
*/
所以我的问题是,格式化长 @param 行(在代码中,而不是在生成的 JSDoc 中)的正确/官方/规范方式是什么……或者实际上任何长注释行。
【问题讨论】:
标签: jsdoc