Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type annotations to lib/utils/immutability.tsx #79

Closed
jho406 opened this issue Jun 22, 2024 · 1 comment
Closed

Add type annotations to lib/utils/immutability.tsx #79

jho406 opened this issue Jun 22, 2024 · 1 comment
Assignees

Comments

@jho406
Copy link
Collaborator

jho406 commented Jun 22, 2024

Context

Continuing with the typescript conversation. immutability.tsx is a set of functions that are lightweight helpers that were imported from Scour.js. They're used to mutate objects using keypaths like foo.bar.posts.id=1.body.

Issue

We have the following eslint warnings:

    7:15  warning  Argument 'message' should be typed  @typescript-eslint/explicit-module-boundary-types
   13:1   warning  Missing return type on function     @typescript-eslint/explicit-module-boundary-types
   13:16  warning  Argument 'obj' should be typed      @typescript-eslint/explicit-module-boundary-types
   13:21  warning  Argument 'path' should be typed     @typescript-eslint/explicit-module-boundary-types
  118:1   warning  Missing return type on function     @typescript-eslint/explicit-module-boundary-types
  118:16  warning  Argument 'object' should be typed   @typescript-eslint/explicit-module-boundary-types
  118:24  warning  Argument 'keypath' should be typed  @typescript-eslint/explicit-module-boundary-types
  118:33  warning  Argument 'value' should be typed    @typescript-eslint/explicit-module-boundary-types

I'm not sure how to type this well, but we can start by just treating the keypath arguments as ordinary strings.

@jho406
Copy link
Collaborator Author

jho406 commented Jun 29, 2024

Picking this up

@jho406 jho406 self-assigned this Jun 29, 2024
@jho406 jho406 closed this as completed Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant