Hello.

I guess that you have the setting `env: {browser: true}` in your eslintrc.
The browser environment defines the global variable `event` since it's a
DOM API that IE has.

If you disallow a use of the `event` global variable, there are 2 ways:

- Disable the browser environment, then you write `globals` setting
manually for necessary variables such as `window`.
- Use `no-restricted-globals` rule.

2017年8月17日(木) 17:45 Jacob Jepsen <[email protected]>:

> Hello,
>
> I am trying to make eslint produce a warning/error when using a variable
> that isn't declared as in the following code:
>
> function Test() {
> event.preventDefault();
> }
> Test();
>
> The variable event is undeclared here. I have tried using the following
> settings
> "no-undef": 1,
> "no-unused-vars": 1,
> "no-use-before-define": 1,
>
> but to no avail. Does anyone have an idea on how to do this?
>
> Best regards,
> Jacob
>
> --
> You received this message because you are subscribed to the Google Groups
> "ESLint" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"ESLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to