question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

require-atomic-updates complains about unrelated variable references

See original GitHub issue

Tell us about your environment

  • ESLint Version: 6.0.1
  • Node Version: 10.15.3
  • npm Version: 6.4.1

What parser (default, Babel-ESLint, etc.) are you using?

default

Please show your full configuration:

Configuration
---
  extends: eslint:recommended
  parserOptions:
    ecmaVersion: 2017

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

async function f() {}

async function t() {
  for (const x of ['A', 'B', 'C']) {
    await f(x);
  }
  for (const x of ['A', 'B', 'C']) {
    await (() => f(x))();
  }
}

t();
> eslint atomic-updates.js

What did you expect to happen?

I get no error or a useful explanation what is wrong with this code.

What actually happened? Please include the actual, raw output from ESLint.

I am getting this linting error:

…/atomic-updates/atomic-updates.js
  7:3  error  Possible race condition: `const x` might be reassigned based on an outdated value of `const x`  require-atomic-updates

✖ 1 problem (1 error, 0 warnings)

Are you willing to submit a pull request to fix this bug?

I expect it to take me quiet long to understand the logic. Therefore not at this moment.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
eslint-deprecated[bot]commented, Sep 24, 2019

Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that accepted issues failing to be implemented after 90 days tend to never be implemented, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

1reaction
mysticateacommented, Jun 26, 2019

@hon2a Thanks. It looks the same issue as #11899.

Read more comments on GitHub >

github_iconTop Results From Across the Web

require-atomic-updates - ESLint - Pluggable JavaScript Linter
This rule aims to report assignments to variables or properties in cases where the assignments may be based on outdated values. Variables. This...
Read more >
Why is require-atomic-updates found here? - Stack Overflow
There are several open github issues referencing this bug, but the gist of it is that require-atomic-updates is currently broken.
Read more >
www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-012...
Indeed, Ada has C.6(22/2) to make it possible for users of Atomic and Volatile objects to be able to match such hardware requirements....
Read more >
What is RCU? – “Read, Copy, Update”
Concurrent RCU readers can then continue accessing the old versions, and can dispense with the atomic operations, memory barriers, and communications cache ...
Read more >
The O*NET® Content Model
Occupational Requirements Work Activities: General • Intermed iate • Detailed Organizational ... To download a reference file of all Content Model elements, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found