gajus/eslint-plugin-flowtype

Rule for requiring types for fn definitions only

Open

#91 创建于 2016年8月27日

在 GitHub 查看
 (11 评论) (0 反应) (0 负责人)JavaScript (167 fork)batch import
help wanted

仓库指标

Star
 (1,078 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

One of Flow's goals was to provide an 'incremental' model, where users could incrementally migrate their code. As a user of this module, I have faced an overwhelming number of issues with the current "flowtype/require-parameter-type" rule, which throws an error on every missing declaration. A rule that would complement flow's goal of 'incremental migration' would be a separate rule for requiring types for function definitions.

Ideally, it would do something like this:

function example(number) {  // <-- require types here
  return new Promise((resolve, reject) => { 
    resolve(someArray.map(each => each)) // <-- DO NOT require types here
  })
}

贡献者指南