Javascript - 哪个 eslint jsdoc 规则/设置强制 @private、@public 或 @protected
是否有任何 eslint jsdoc 规则/设置来强制 @private
、@public
或 @protected
?使用模块 eslint-plugin-jsdoc 没有强制的规则/设置它。
以下示例应引发 eslint jsdoc 错误:
/**
* @param {string} foo
*/
function quux (foo) {
}
不应接受此 jsDoc,因为 @private
、@public
或 @protected
不可用。
也许你可以帮助我。 谢谢。
Is there any eslint jsdoc rule/setting to force either @private
, @public
or @protected
? With the module eslint-plugin-jsdoc there is no rule/setting to force it.
Following example should throw a eslint jsdoc error:
/**
* @param {string} foo
*/
function quux (foo) {
}
This jsDoc should not accepted because @private
, @public
or @protected
are not available.
Maybe you can help me.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 jsdoc/no-restricted-syntax 规则,禁止没有这些访问修饰符的块。
将其添加到您的 eslint 配置文件中:
You can use the
jsdoc/no-restricted-syntax
rule, disallowing blocks which don't have those access modifiers.Add this to your eslint config file: