-
Notifications
You must be signed in to change notification settings - Fork 150
no-node-access
rule output false-positive warning after 7.5.0 release
#1024
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
Comments
What if I name the constant differently? I think it's a bit too much to expect that everyone will call it the same. Can we instead validate the typing on which the event trigger is called? In this case it would be |
That would make TypeScript a requirement for this to be usable, which not everyone uses (though an enhanced version of this rule for TypeScript-based projects would be a cool addition) You could improve accuracy by using logic similar to what we do in i.e.
Our utility will correctly determine that both There are other improvements that could be made afterwards too, for example while it'd be rare, you could easily also check if the subject has an explicit |
I would say though in the meantime it would be good to get a patch doing what @Belco90 suggested since right now this is flagging very valid code (I've got 194 errors in one project alone, just by updating - all of which are false positives 😅) |
🎉 This issue has been resolved in version 7.5.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
That's the ideal fix indeed, but wanted to exclude @G-Rath thanks for sharing how is handled in |
Uh oh!
There was an error while loading. Please reload this page.
Have you read the Troubleshooting section?
Yes
Plugin version
7.5.0
ESLint version
9.28.0
Node.js version
22.15.0
Bug description
When upgrading the
eslint-plugin-testing-library
to the latest release today I have found out few new ESLintno-node-access
rule warnings which seems to be a false-positives.Steps to reproduce
Error output/screenshots
ESLint configuration
ESLint flat config chunk related to Testing Library:
Rule(s) affected
no-node-access
Anything else?
No response
Do you want to submit a pull request to fix this bug?
No
The text was updated successfully, but these errors were encountered: