gajus / gajus/eslint-plugin-flowtype
Rule for requiring types for fn definitions only
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Description
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:
``` js
function example(number) { // <-- require types here
return new Promise((resolve, reject) => {
resolve(someArray.map(each => each)) // <-- DO NOT require types here
})
}
```
Contributor guide
Research direction
The issue names the existing flowtype/require-parameter-type rule but gives no file or test path. Start by locating that rule and its tests, then compare how function definitions and nested callbacks are identified. Done means a separate rule requires types for function definitions while leaving the shown nested callbacks unrequired.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100