[英]javascript/typescript - force to pass object as function argument by eslint rule
Is it possible to force the following rule by eslint?是否可以通过 eslint 强制执行以下规则?
For example,例如,
I checked the official document ( https://eslint.org/docs/rules/ ), but I couldn't find appropriate rules.我查看了官方文档( https://eslint.org/docs/rules/ ),但找不到合适的规则。 I wonder if some kind of custom rules can realize this.我想知道是否某种自定义规则可以实现这一点。
You can use max-params
rule.您可以使用max-params
规则。 https://eslint.org/docs/rules/max-params Set the max
value to 1
. https://eslint.org/docs/rules/max-params将max
设置为1
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.