【问题标题】:ESLint Rule to enforce not to use parentheses for single argument arrow functionsESLint 规则强制对单参数箭头函数不使用括号
【发布时间】:2019-11-27 08:20:08
【问题描述】:

我想知道是否有 ESLint 规则强制开发人员不要对单参数箭头函数使用括号。

// good
const handleKeyValues = prop => {

// warn
const handleKeyValues = (prop) => {

【问题讨论】:

    标签: eslint


    【解决方案1】:

    具有“按需”值的 arrow-parens 规则应该强制执行。

    【讨论】:

      猜你喜欢
      • 2022-01-08
      • 1970-01-01
      • 2017-09-13
      • 1970-01-01
      • 2023-02-04
      • 2020-06-21
      • 2018-08-31
      • 2016-05-28
      相关资源
      最近更新 更多