Skip to content
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

prefer-number-properties can't detect usages via global object #1439

Closed
EvgenyOrekhov opened this issue Jul 21, 2021 · 3 comments · Fixed by #1829 or #1832
Closed

prefer-number-properties can't detect usages via global object #1439

EvgenyOrekhov opened this issue Jul 21, 2021 · 3 comments · Fixed by #1829 or #1832
Assignees
Labels

Comments

@EvgenyOrekhov
Copy link
Contributor

EvgenyOrekhov commented Jul 21, 2021

I think prefer-number-properties should detect usages via global/window/self:

globalThis.isNaN(foo);
global.isNaN(foo);
window.isNaN(foo);
self.isNaN(foo);

globalThis.isFinite(foo);
global.isFinite(foo);
window.isFinite(foo);
self.isFinite(foo);
@fisker
Copy link
Collaborator

fisker commented Jul 22, 2021

Actually, I tried to use this to track global isNaN when I implement this rule, the reason I give up this solution is it can't report anything if {globals: {isNaN: "off"}} which I already did in my personal config. But maybe I was wrong? Welcome to give a shot.

@fisker
Copy link
Collaborator

fisker commented May 26, 2022

not fixed

@fisker fisker reopened this May 26, 2022
@EvgenyOrekhov
Copy link
Contributor Author

Also added globalThis to examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants