Skip to content

Commit

Permalink
chore: turn off mocha/handle-done-callback rule as a workaround
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
raymondfeng committed Sep 3, 2020
1 parent 595951c commit 70845d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module.exports = {
* The mocha plugin reports the following signature as a violation of
* `mocha/handle-done-callback` (misinterpreting `this` as `done`).
*
* See https://github.com/lo1tuma/eslint-plugin-mocha/issues/270
*
* ```ts
* before(async function setupApplication(this: Mocha.Context) {
* this.timeout(6000);
Expand Down
17 changes: 0 additions & 17 deletions packages/eslint-config/eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,23 +255,6 @@ module.exports = {
'@typescript-eslint/prefer-nullish-coalescing': 'off',
},
},
{
files: ['**/*.ts'],
rules: {
/*
* The mocha plugin reports the following signature as a violation of
* `mocha/handle-done-callback`.
*
* ```ts
* before(async function setupApplication(this: Mocha.Context) {
* this.timeout(6000);
* // ...
* }
* ```
*/
'mocha/handle-done-callback': 'off',
},
},
],
};

Expand Down

0 comments on commit 70845d2

Please sign in to comment.