Skip to content

Document decode as function instead of method, to silence ESLint. #430

@patroza

Description

@patroza

🚀 Feature request

Current Behavior

flow(
    SomeIOType.decode,
    ... etc
)

Accessing .decode of a type by passing it, causes lint warning:
warning Avoid referencing unbound methods which may cause unintentional scoping of this @typescript-eslint/unbound-method

However the function is specifically bound: this.decode = this.decode.bind(this);

Desired Behavior

Passing .decode should not cause a warning

Suggested Solution

Document decode on the type as function instead of method.

Who does this impact? Who is this for?

Typescript users with recommended lint rules.

Describe

Your environment

Software Version(s)
io-ts 2.1.2
fp-ts 2.5.3
TypeScript 3.8.3

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