Skip to content

Commit 1539ea5

Browse files
committed
feat: add no-unneeded-async-expect-function to recommended config
BREAKING CHANGE: `no-unneeded-async-expect-function` is now enabled in the `recommended` config
1 parent ec19154 commit 1539ea5

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ Manually fixable by
351351
| [no-standalone-expect](docs/rules/no-standalone-expect.md) | Disallow using `expect` outside of `it` or `test` blocks || | | |
352352
| [no-test-prefixes](docs/rules/no-test-prefixes.md) | Require using `.only` and `.skip` over `f` and `x` || | 🔧 | |
353353
| [no-test-return-statement](docs/rules/no-test-return-statement.md) | Disallow explicitly returning from tests | | | | |
354-
| [no-unneeded-async-expect-function](docs/rules/no-unneeded-async-expect-function.md) | Disallow unnecessary async function wrapper for expected promises | | | 🔧 | |
354+
| [no-unneeded-async-expect-function](docs/rules/no-unneeded-async-expect-function.md) | Disallow unnecessary async function wrapper for expected promises | | | 🔧 | |
355355
| [no-untyped-mock-factory](docs/rules/no-untyped-mock-factory.md) | Disallow using `jest.mock()` factories without an explicit type parameter | | | 🔧 | |
356356
| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | Enforce padding around `afterAll` blocks | | | 🔧 | |
357357
| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | Enforce padding around `afterEach` blocks | | | 🔧 | |

docs/rules/no-unneeded-async-expect-function.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Disallow unnecessary async function wrapper for expected promises (`no-unneeded-async-expect-function`)
22

3+
💼 This rule is enabled in the ✅ `recommended`
4+
[config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#shareable-configurations).
5+
36
🔧 This rule is automatically fixable by the
47
[`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
58

src/__tests__/__snapshots__/rules.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ exports[`rules should export configs that refer to actual rules 1`] = `
217217
"jest/no-mocks-import": "error",
218218
"jest/no-standalone-expect": "error",
219219
"jest/no-test-prefixes": "error",
220+
"jest/no-unneeded-async-expect-function": "error",
220221
"jest/valid-describe-callback": "error",
221222
"jest/valid-expect": "error",
222223
"jest/valid-expect-in-promise": "error",
@@ -280,6 +281,7 @@ exports[`rules should export configs that refer to actual rules 1`] = `
280281
"jest/no-mocks-import": "error",
281282
"jest/no-standalone-expect": "error",
282283
"jest/no-test-prefixes": "error",
284+
"jest/no-unneeded-async-expect-function": "error",
283285
"jest/valid-describe-callback": "error",
284286
"jest/valid-expect": "error",
285287
"jest/valid-expect-in-promise": "error",

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const recommendedRules = {
4646
'jest/no-mocks-import': 'error',
4747
'jest/no-standalone-expect': 'error',
4848
'jest/no-test-prefixes': 'error',
49+
'jest/no-unneeded-async-expect-function': 'error',
4950
'jest/valid-describe-callback': 'error',
5051
'jest/valid-expect': 'error',
5152
'jest/valid-expect-in-promise': 'error',

0 commit comments

Comments
 (0)