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
no-obj-calls should report Atomics() #12234
no-obj-calls should report Atomics() #12234
Comments
I'm okay with a semver-minor change for the refactor. As for adding |
That's the initial idea, to report only if it's a reference to a global variable. Not if it is shadowed, and not if the variable doesn't exist at all. That would apply to Global Would it be okay, or did you mean something else by known/accepted global? |
I was referring to having the global be identified as such through env or global config or |
I think it wouldn't be a problem to implement that check using the |
Similar to
Math
,JSON
andReflect
, which the no-obj-calls rule already reports,Atomics
is not a function.Atomics in ECMAScript 2017 spec:
What rule do you want to change?
no-obj-calls
Does this change cause the rule to produce more or fewer warnings?
more
How will the change be implemented? (New option, new default behavior, etc.)?
new default behavior
It would be also good to ensure that the reported variables are global.
Please provide some example code that this change will affect:
What does the rule currently do for this code?
No errors
What will the rule do after it's changed?
Error:
'Atomics' is not a function.
Are you willing to submit a pull request to implement this change?
Yes. The idea is to add
Atomics
and also useReferenceTracker
to report only global variables (for all 4 targeted globals) in the same PR.Would it be okay for a semver-minor? I think that when
Reflect
was added to this rule it was seen as a bug fix (#7710 #7700).The text was updated successfully, but these errors were encountered: