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
Bug: require-atomic-updates misleading error message #15076
Comments
I’m not very familiar with this rule, by based on the rather nonsensical error message it’s producing, I’d guess this is a bug. @eslint/eslint-tsc thoughts? |
This invalid test case added in #11774 looks to be related: It looks like even though different properties on the object are being read and assigned, the rule considers the whole object stale. I can’t tell based on the issue and PR discussion whether that behavior is intentional, however. |
I agree this sounds pretty much like a duplicate of #11899 - feel free to close this if it makes sense for you and thanks for looking into this. |
Thanks for the confirmation! I'll mark this as accepted to fix the error message (it doesn't seem it was mentioned in #11899), and I'm working on that. |
Environment
Node version: v14.15.5
npm version: 7.23.0
Local ESLint version: 7.32.0
Global ESLint version: -
Operating System: Ubuntu 20.04
What parser are you using?
Default (Espree)
What did you do?
Configuration
Playground version
What did you expect to happen?
I would expect the above code not to raise
require-atomic-updates
.What actually happened?
I'm seeing
Participation
Additional comments
This started happening after adding a simple condition where
opts.spec
might be assigned toprocess.stdin
.Before the change code read like this and passed the rule:
I have a hard time understanding how the change introduces a possible race condition (maybe I'm wrong though), so I would assume this is a bug. In case it is a bug I would be happy to submit a PR in case someone can point me to a place where I can start.
Edit: unwrapping the async function and using a Promise chain instead does not raise any warnings when including the conditional assignment:
The text was updated successfully, but these errors were encountered: