-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
require-atomic-updates: document.title (false positive) #11967
Comments
This JS would cause the problem being warned about: document.title = 'original title';
test();
document.title = 'surprise!'; In other words, the value you're clobbering ( |
@ljharb : Of course not! Therefore, this is a bug. Why doesn't eslint also produce a race condition error if For example, here, esilint does NOT produce the race condition error:
Also, if you leave
Keep in mind, that the entire program is only those 7 lines you see in the first code segment of my original post. Where in those 7 lines do you see two things racing to set a value? I agree that the function I posted is not pure (from a functional programming perspective), but there is no race condition. And, no error should occur; this is a bug. |
I have to agree, I'm not sure why this is anything but a bug. As for |
Thank you for your report. I think this is a duplicate of #11899. Please track that issue. |
I'm using eslint 6.0.1 and believe I'm getting a false positive for the require-atomic-updates rule. Here's a code sample which reproduces the false-positive:
The line
document.title = "Test";
(above) produces this error:However, if I change
document.title
towindow.document.title
eslint does NOT produce the error:The text was updated successfully, but these errors were encountered: