Skip to content

Commit 47a1844

Browse files
gonzaotcAndile Sizophila MchunuAmxx
authored
eslint rule for no async in describe blocks via eslint-plugin-mocha (#6438)
Co-authored-by: Andile Sizophila Mchunu <andilexmchunu@gmail.com> Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
1 parent db06a6e commit 47a1844

6 files changed

Lines changed: 39 additions & 3 deletions

File tree

eslint.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import js from '@eslint/js';
22
import { includeIgnoreFile } from '@eslint/compat';
3+
import mocha from 'eslint-plugin-mocha';
34
import prettier from 'eslint-config-prettier';
45
import globals from 'globals';
56
import path from 'path';
@@ -10,6 +11,12 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
1011
export default [
1112
js.configs.recommended,
1213
prettier,
14+
{
15+
plugins: { mocha },
16+
rules: {
17+
'mocha/no-async-suite': 'error',
18+
},
19+
},
1320
{
1421
languageOptions: {
1522
ecmaVersion: 2022,

package-lock.json

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"chai": "^4.2.0",
7070
"eslint": "^9.0.0",
7171
"eslint-config-prettier": "^10.0.0",
72+
"eslint-plugin-mocha": "^11.2.0",
7273
"ethers": "^6.16.0",
7374
"glob": "^13.0.0",
7475
"globals": "^17.0.0",

test/access/manager/AccessManager.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ describe('AccessManager', function () {
11081108
expect(await this.manager.isTargetClosed(this.target)).to.be.false;
11091109
});
11101110

1111-
describe('when the target is the manager', async function () {
1111+
describe('when the target is the manager', function () {
11121112
it('closes and opens the manager', async function () {
11131113
await expect(this.manager.connect(this.admin).setTargetClosed(this.manager, true))
11141114
.to.emit(this.manager, 'TargetClosed')

test/crosschain/BridgeERC1155.behavior.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function shouldBehaveLikeBridgeERC1155({ chainAIsCustodial = false, chainBIsCust
2727
]);
2828
});
2929

30-
describe('crosschain send (both direction)', async function () {
30+
describe('crosschain send (both direction)', function () {
3131
it('single', async function () {
3232
const [alice, bruce, chris] = this.accounts;
3333

test/token/ERC6909/ERC6909.behavior.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function shouldBehaveLikeERC6909() {
142142
await expect(this.token.balanceOf(this.recipient, firstTokenId)).to.eventually.equal(amount);
143143
});
144144

145-
describe('with approval', async function () {
145+
describe('with approval', function () {
146146
beforeEach(async function () {
147147
await this.token.connect(this.holder).approve(this.operator, firstTokenId, amount);
148148
});

0 commit comments

Comments
 (0)