在ESLint配置文件中添加以下规则:
"rules": {
"lines-around-comment": ["error", {
"allowBlockStart": true,
"allowBlockEnd": true,
"allowObjectStart": true,
"allowObjectEnd": true,
"allowArrayStart": true,
"allowArrayEnd": true,
"ignorePattern": "^\\*\\s",
"applyDefaultPatterns": true
}]
}
这将允许在JSDoc注释周围不使用行分隔符,但仍需要在注释内按照JSDoc规范使用行分隔符。例如:
/**
* This is a JSDoc comment
* that spans multiple lines.
*
* @param {string} foo - The foo parameter.
* @param {number} bar - The bar parameter.
* @returns {boolean} The return value.
*/
function example(foo, bar) {
return true;
}
上一篇:不强制推送的变基