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
Detect the React and Flow versions relative to the file being linted. #2943
Detect the React and Flow versions relative to the file being linted. #2943
Conversation
…ibling and child projects Fixes jsx-eslint#2218
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Can you perhaps add some tests without altering the existing ones?
You're welcome! I can't wait to get this in. :) Basically all I did was swap out using I didn't add any new tests since the changes I made don't really change the expected output. There wasn't anything new or different to test per say. If you can think of something that needs testing I would be happy to add it. |
The issue this fixes is that with nested dirs and deps, the wrong version is detected. To test this, I think we'd need some fixture files that replicate the issue, and verify that the version is detected properly. |
That makes sense. I'll put together a test that replicates it. |
Added tests that verify versions are correctly detected for both sibling and child projects. @ljharb Let me know if this adequately covers what you were thinking. |
I'm still a bit confused; the existing tests use |
It isn't needed anymore. The purpose of |
257fa48
to
eeb9273
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tweaked the test a bit to use sinon instead of reassignment, otherwise LGTM!
This fixes #2218. This changes version.js to detect the React and Flow versions relative to the file being linted.