-
Notifications
You must be signed in to change notification settings - Fork 61
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
The handle-done-callback rule cannot handle TypeScript this parameter #270
Comments
The mocha plugin incorretly reports the following signature as a violation of `mocha/handle-done-callback` (misinterpreting `this` as `done`). ```ts before(async function setupApplication(this: Mocha.Context) { this.timeout(6000); // ... }); ``` See lo1tuma/eslint-plugin-mocha#270 Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
Which parser are you using? I think this should be rather fixed in |
I use |
@lo1tuma Do you recommend we open an issue against |
The mocha plugin incorretly reports the following signature as a violation of `mocha/handle-done-callback` (misinterpreting `this` as `done`). ```ts before(async function setupApplication(this: Mocha.Context) { this.timeout(6000); // ... }); ``` See lo1tuma/eslint-plugin-mocha#270 Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
The mocha plugin incorretly reports the following signature as a violation of `mocha/handle-done-callback` (misinterpreting `this` as `done`). ```ts before(async function setupApplication(this: Mocha.Context) { this.timeout(6000); // ... }); ``` See lo1tuma/eslint-plugin-mocha#270 Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
I run into the same problem. Is there any other solution than deactivating the rule for TypeScript files? |
The issue can be reproduced with the following TypeScript code:
Please note this parameter is used.
The
handle-done-callback
rule marks it as a violation incorrectly.It's also interesting to note that the function is
async
.The text was updated successfully, but these errors were encountered: