Skip to content

Eliminate use of any type (and consequential eslint suppression) #2

@dlh3

Description

@dlh3

This was my first TypeScript project and I'm really struggling with how to deal with types on freeform objects. That is to say, I need to operate on objects that I don't control, so I can't define a tight schema for them.

That's where KeyableObject comes in. I created this interface to represent an object which may or may not have a key property.

I was able to avoid any almost everywhere, except for in two of the KeyGenerators parameters (actually, in the GeneratorFuncs that the KeyGenerators provide).
https://github.com/dlh3/react-key-generator/blob/master/src/keyGenerators.ts#L14-L23

I would appreciate any community help to eliminate those two uses of any, and perhaps cleanup the typing in any other ways you see fit.

I am hoping I can convince @cwparsons to help out here. 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions