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

Fix: Ambiguous argument type definition #640

Merged
merged 1 commit into from Aug 26, 2022

Conversation

willvedd
Copy link
Contributor

✏️ Changes

A routine Typescript upgrade from 4.7.4 to 4.8.2 has imposed stricter checks on argument type definitions. More specifically, forbidding "unused property renaming in destructuring binding in function types" as described in this Typescipt project PR.

This was tripping up CircleCI when running the E2E CLI tests during the Typescript compilation step. The errors looked something like this:

src/types.ts:46:20 - error TS2842: 'string' is an unused renaming of 'id'. Did you intend to use it as a type annotation?

46     deploy: ({ id: string }) => Promise<void>;
                      ~~~~~~

  src/types.ts:46:28
    46     deploy: ({ id: string }) => Promise<void>;
                                  ~
    We can only write a type for 'id' by adding a type for the entire parameter here.

src/types.ts:48:40 - error TS2842: 'string' is an unused renaming of 'trigger_id'. Did you intend to use it as a type annotation?

48     getTriggerBindings: ({ trigger_id: string }) => Promise<{ bindings: Asset[] }>;

For this project, it just means being a little more explicit with the argument definition.

🔗 References

🎯 Testing

No additional tests necessary. Typescript compiler succeeds now.

@willvedd willvedd requested a review from a team as a code owner August 26, 2022 11:27
@codecov-commenter
Copy link

Codecov Report

Merging #640 (ded483f) into master (fb9453d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #640   +/-   ##
=======================================
  Coverage   83.31%   83.31%           
=======================================
  Files         114      114           
  Lines        3315     3315           
  Branches      611      611           
=======================================
  Hits         2762     2762           
  Misses        323      323           
  Partials      230      230           
Impacted Files Coverage Δ
src/types.ts 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@willvedd willvedd merged commit 0858e5a into master Aug 26, 2022
@willvedd willvedd deleted the fix-arbitrary-arg-type-definition branch August 26, 2022 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants