Skip to content

Commit 5c475c2

Browse files
committed
Update eslint-plugin-testing-library to v7.15.4
- Enable `testing-library/prefer-user-event-setup` as an error. - Change `testing-library/await-async-queries` to warning as a fixer is available. - Change `testing-library/await-async-utils` to warning as a fixer is available. - Change `testing-library/no-await-sync-queries` to warning as a fixer is available. - Change `testing-library/no-wait-for-multiple-assertions` to warning as a fixer is available.
1 parent 334aa21 commit 5c475c2

File tree

4 files changed

+28
-23
lines changed

4 files changed

+28
-23
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"eslint-plugin-rxjs-x": "~0.8.4",
5151
"eslint-plugin-security": "^3.0.1",
5252
"eslint-plugin-simple-import-sort": "^12.1.1",
53-
"eslint-plugin-testing-library": "^7.6.6",
53+
"eslint-plugin-testing-library": "^7.15.4",
5454
"eslint-plugin-unicorn": "^60.0.0",
5555
"typescript-eslint": "^8.52.0"
5656
},
@@ -93,7 +93,7 @@
9393
"eslint-plugin-rxjs-x": "0.8.4",
9494
"eslint-plugin-security": "3.0.1",
9595
"eslint-plugin-simple-import-sort": "12.1.1",
96-
"eslint-plugin-testing-library": "7.6.6",
96+
"eslint-plugin-testing-library": "7.15.4",
9797
"eslint-plugin-unicorn": "60.0.0",
9898
"gulp": "^5.0.1",
9999
"jest": "^30.2.0",

src/config/testing-library/index.adoc

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ and anticipate common mistakes when writing tests with https://testing-library.c
1616

1717
| `link:{eslint-testing-library-rules}/await-async-queries.md[testing-library/await-async-queries]`
1818
| Yes
19-
|
20-
| Error
19+
| Yes
20+
| Warning
2121

2222
| `link:{eslint-testing-library-rules}/await-async-utils.md[testing-library/await-async-utils]`
2323
| Yes
24-
|
25-
| Error
24+
| Yes
25+
| Warning
2626

2727
| `link:{eslint-testing-library-rules}/consistent-data-testid.md[testing-library/consistent-data-testid]`
2828
|
@@ -36,8 +36,8 @@ and anticipate common mistakes when writing tests with https://testing-library.c
3636

3737
| `link:{eslint-testing-library-rules}/no-await-sync-queries.md[testing-library/no-await-sync-queries]`
3838
| Yes
39-
|
40-
| Error
39+
| Yes
40+
| Warning
4141

4242
| `link:{eslint-testing-library-rules}/no-container.md[testing-library/no-container]`
4343
| Yes
@@ -91,8 +91,8 @@ and anticipate common mistakes when writing tests with https://testing-library.c
9191

9292
| `link:{eslint-testing-library-rules}/no-wait-for-multiple-assertions.md[testing-library/no-wait-for-multiple-assertions]`
9393
| Yes
94-
|
95-
| Error
94+
| Yes
95+
| Warning
9696

9797
| `link:{eslint-testing-library-rules}/no-wait-for-side-effects.md[testing-library/no-wait-for-side-effects]`
9898
| Yes
@@ -144,6 +144,11 @@ and anticipate common mistakes when writing tests with https://testing-library.c
144144
|
145145
| Error
146146

147+
| `link:{eslint-testing-library-rules}/prefer-user-event-setup.md[testing-library/prefer-user-event-setup]`
148+
|
149+
|
150+
| Error
151+
147152
| `link:{eslint-testing-library-rules}/render-result-naming-convention.md[testing-library/render-result-naming-convention]`
148153
| Yes
149154
|

src/config/testing-library/testing-library-config.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ export function testingLibraryConfig(files: Glob[] = jestFiles): Linter.Config {
1616
},
1717
rules: {
1818
'testing-library/await-async-events': 'off',
19-
'testing-library/await-async-queries': 'error',
20-
'testing-library/await-async-utils': 'error',
19+
'testing-library/await-async-queries': 'warn',
20+
'testing-library/await-async-utils': 'warn',
2121
// Vue.js only
2222
'testing-library/consistent-data-testid': ['error', {
2323
testIdPattern: '^[a-z0-9]+(-[a-z0-9]+)*$',
2424
testIdAttribute: 'data-testId',
2525
}],
2626
'testing-library/no-await-sync-events': 'error',
27-
'testing-library/no-await-sync-queries': 'error',
27+
'testing-library/no-await-sync-queries': 'warn',
2828
'testing-library/no-container': 'error',
2929
'testing-library/no-debugging-utils': 'error',
3030
'testing-library/no-dom-import': 'warn',
@@ -36,7 +36,7 @@ export function testingLibraryConfig(files: Glob[] = jestFiles): Linter.Config {
3636
'testing-library/no-test-id-queries': 'error',
3737
// React only
3838
'testing-library/no-unnecessary-act': 'off',
39-
'testing-library/no-wait-for-multiple-assertions': 'error',
39+
'testing-library/no-wait-for-multiple-assertions': 'warn',
4040
'testing-library/no-wait-for-side-effects': 'error',
4141
'testing-library/no-wait-for-snapshot': 'error',
4242
'testing-library/prefer-explicit-assert': 'off',
@@ -51,6 +51,7 @@ export function testingLibraryConfig(files: Glob[] = jestFiles): Linter.Config {
5151
'testing-library/prefer-query-matchers': 'off',
5252
'testing-library/prefer-screen-queries': 'error',
5353
'testing-library/prefer-user-event': 'error',
54+
'testing-library/prefer-user-event-setup': 'error',
5455
'testing-library/render-result-naming-convention': 'error',
5556
},
5657
};

0 commit comments

Comments
 (0)