eslint-plugin-mocha
eslint-plugin-mocha copied to clipboard
The handle-done-callback rule cannot handle TypeScript this parameter
The issue can be reproduced with the following TypeScript code:
before(async function setupApplication(this: Mocha.Context) {
this.timeout(6000);
}
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
.
Which parser are you using? I think this should be rather fixed in @typescript-eslint/parser
.
I use @typescript-eslint/parser
. See https://github.com/strongloop/loopback-next/blob/renovate/major-typescript-eslint-monorepo/packages/eslint-config/eslintrc.js#L16
@lo1tuma Do you recommend we open an issue against @typescript-eslint/parser
?
I run into the same problem. Is there any other solution than deactivating the rule for TypeScript files?