Skip to content

no-invalid-this in addEventListener anonymous function #17750

Answered by mdjermanovic
erosman asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for the lack of response.

This rule can't be aware of all APIs, so in these cases you'll need to use eslint-disable comments.

We also have a few in the eslint codebase, for example:

eslint/tests/lib/cli.js

Lines 87 to 95 in 9007719

before(function() {
/*
* GitHub Actions Windows and macOS runners occasionally exhibit
* extremely slow filesystem operations, during which copying fixtures
* exceeds the default test timeout, so raise it just for this hook.
* Mocha uses `this` to set timeouts on an individual hook level.
*/
this.timeout(60 * 1000); // eslint-disable-line no-invalid-this -- Mocha API

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Rec0iL99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants