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

new Image() is no-undef #562

Closed
sospedra opened this issue Jul 10, 2016 · 2 comments

Comments

@sospedra
Copy link

commented Jul 10, 2016

When using HTMLImageElement as new Image() standard triggers a no-undef warning. Is this expected? I mean, Image is global... always :/

@rstacruz

This comment has been minimized.

Copy link
Member

commented Jul 10, 2016

It is, in the "browser" environment. Use /* eslint-env browser */ at the
beginning of your file, or (recommended) simply use window.Image.

On Mon, Jul 11, 2016, 12:29 AM Rubén Sospedra notifications@github.com
wrote:

When using HTMLImageElement
https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement as new
Image() standard triggers a no-undef warning. Is this expected? I mean,
Image is global... always :/


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#562, or mute the thread
https://github.com/notifications/unsubscribe/AAEikZmz6I0Y3UUa0lEuv3_Z-Qdw9FbOks5qUR3vgaJpZM4JI3f3
.

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2016

@sospedra we tend to limit the amount of globals exposed in the browser, because there are so many of them. Only window and document are typically exposed. Try running new window.Image() instead. Cheers!

@dcousens dcousens added the question label Jul 11, 2016

@dcousens dcousens closed this Jul 11, 2016

@Schultzer Schultzer referenced this issue Dec 4, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.