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

Change any to unknown #477

Conversation

keeganwitt
Copy link
Collaborator

@keeganwitt keeganwitt commented Jul 20, 2022

A follow-up to this conversation. We need the second argument to be an array, then we can use unknown instead of any, and this is the best practice.

After starting this change, I realized there were multiple places we could change an any to unknown.

@codecov
Copy link

codecov bot commented Jul 20, 2022

Codecov Report

Merging #477 (d97afc9) into main (552e950) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main      #477   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           71        71           
  Lines          582       582           
  Branches       148       148           
=========================================
  Hits           582       582           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 552e950...d97afc9. Read the comment docs.

@keeganwitt keeganwitt force-pushed the change_mockinstance_generics_to_unknown branch 2 times, most recently from d6aae48 to 7a971ff Compare July 21, 2022 03:04
@SimenB
Copy link
Member

SimenB commented Jul 21, 2022

Remove this as well?

jest-extended/.eslintrc

Lines 55 to 56 in 801c068

// should probably enable this, but it's a bit too strict for now
"@typescript-eslint/no-explicit-any": "off"

@keeganwitt
Copy link
Collaborator Author

Remove this as well?

jest-extended/.eslintrc

Lines 55 to 56 in 801c068

// should probably enable this, but it's a bit too strict for now
"@typescript-eslint/no-explicit-any": "off"

There are 71 any usages left still in index.d.ts. However, there aren't any elsewhere, so maybe it'd still be a better default and turn off the rule just for this 1 file.

@SimenB
Copy link
Member

SimenB commented Jul 21, 2022

Only ts-file we've got atm, so that makes sense

@keeganwitt keeganwitt force-pushed the change_mockinstance_generics_to_unknown branch from 43bdca1 to 8e13fd5 Compare July 27, 2022 18:29
@keeganwitt keeganwitt force-pushed the change_mockinstance_generics_to_unknown branch from 8e13fd5 to ccb28ce Compare July 27, 2022 19:50
@keeganwitt keeganwitt force-pushed the change_mockinstance_generics_to_unknown branch from ccb28ce to d97afc9 Compare August 1, 2022 04:00
@keeganwitt keeganwitt changed the title Change MockInstance generics to unknown Change any to unknown Aug 1, 2022
@keeganwitt keeganwitt merged commit 7697c7b into jest-community:main Aug 3, 2022
12 checks passed
@keeganwitt keeganwitt deleted the change_mockinstance_generics_to_unknown branch August 3, 2022 21:06
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

2 participants