gajus / gajus/eslint-plugin-flowtype

flowtype/require-types-at-top is thrown when mixing type/ declaration

Open
#373 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
1.1k
Forks
151
PR merge metrics
No merged PRs in 30d

Description

```js
declare function DataPoolConnectMethodType (): Promise;
declare function DataPoolConnectMethodType ((connection: DatabaseIsolatedPoolConnectionType) => Promise): Promise;

type FooType = string;

```

Expected:

No warnings.

Actual:

Getting "flowtype/require-types-at-top" error.

Contributor guide

Open the contributing guide

Research direction

Start at the flowtype/require-types-at-top rule entry point and reproduce the reported JavaScript snippet. Check why the type declaration after the declare functions is reported, then verify that the example produces no warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.