Skip to content

[Request]: Require Type Definitions First #285

@bradennapier

Description

@bradennapier

I can see it being a good rule to enforce all type definitions being at the top of the file.

good

/* @flow */

type MyType = number

const b: MyType = 2

function foo(): MyType {
     return b
}

bad

/* @flow */

function foo(): MyType {
     return b
}

type MyType = number 

const b: MyType = 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions