Skip to content

Commit 70845d2

Browse files
committed
chore: turn off mocha/handle-done-callback rule as a workaround
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 <[email protected]>
1 parent 595951c commit 70845d2

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

.eslintrc.js

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ module.exports = {
1717
* The mocha plugin reports the following signature as a violation of
1818
* `mocha/handle-done-callback` (misinterpreting `this` as `done`).
1919
*
20+
* See https://github.com/lo1tuma/eslint-plugin-mocha/issues/270
21+
*
2022
* ```ts
2123
* before(async function setupApplication(this: Mocha.Context) {
2224
* this.timeout(6000);

packages/eslint-config/eslintrc.js

-17
Original file line numberDiff line numberDiff line change
@@ -255,23 +255,6 @@ module.exports = {
255255
'@typescript-eslint/prefer-nullish-coalescing': 'off',
256256
},
257257
},
258-
{
259-
files: ['**/*.ts'],
260-
rules: {
261-
/*
262-
* The mocha plugin reports the following signature as a violation of
263-
* `mocha/handle-done-callback`.
264-
*
265-
* ```ts
266-
* before(async function setupApplication(this: Mocha.Context) {
267-
* this.timeout(6000);
268-
* // ...
269-
* }
270-
* ```
271-
*/
272-
'mocha/handle-done-callback': 'off',
273-
},
274-
},
275258
],
276259
};
277260

0 commit comments

Comments
 (0)