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: use the last reference definition when checking jest fn scope #1109

Merged
merged 2 commits into from
May 14, 2022

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented May 14, 2022

I've thought up a few more theoretical ways that you can have multiple definitions but so far none that are actually valid so vanilla ESLint errors on them and while TypeScript parses them they're not valid.

I have changed the code to grab the last definition, because I think that is technically the more correct one (e.g. for function overloads the last definition has to be the implementation, even though there's no way that'll be something we care about here) & it's cheap.

Resolves #1108

@G-Rath G-Rath added the bug label May 14, 2022
@G-Rath G-Rath merged commit 1b2b9c1 into main May 14, 2022
@G-Rath G-Rath deleted the support-multiple-definitions branch May 14, 2022 21:26
github-actions bot pushed a commit that referenced this pull request May 14, 2022
## [26.2.2](v26.2.1...v26.2.2) (2022-05-14)

### Bug Fixes

* use the last reference definition when checking jest fn scope ([#1109](#1109)) ([1b2b9c1](1b2b9c1))
@github-actions
Copy link

🎉 This PR is included in version 26.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: Reference unexpected had more than one definition - please file a github issue
1 participant