Thanks for this. You were absolutely right, I did have 'browser: true'.
After turning it off and doing the other thing you said, it worked
perfectly.
Den torsdag den 17. august 2017 kl. 15.50.30 UTC+2 skrev 長島徹:
>
> 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] <javascript:>>:
>
>> 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] <javascript:>.
>> 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.