This repository was archived by the owner on Mar 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
src/rules/testing-library Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import type { PreferExplicitAssertRule } from './prefer-explicit-assert';
21
21
import type { PreferFindByRule } from './prefer-find-by' ;
22
22
import type { PreferPresenceQueriesRule } from './prefer-presence-queries' ;
23
23
import type { PreferQueryByDisappearanceRule } from './prefer-query-by-disappearance' ;
24
+ import type { PreferQueryMatchersRule } from './prefer-query-matchers' ;
24
25
import type { PreferScreenQueriesRule } from './prefer-screen-queries' ;
25
26
import type { PreferUserEventRule } from './prefer-user-event' ;
26
27
import type { PreferWaitForRule } from './prefer-wait-for' ;
@@ -52,6 +53,7 @@ export type TestingLibraryRules = AwaitAsyncQueryRule &
52
53
PreferFindByRule &
53
54
PreferPresenceQueriesRule &
54
55
PreferQueryByDisappearanceRule &
56
+ PreferQueryMatchersRule &
55
57
PreferScreenQueriesRule &
56
58
PreferUserEventRule &
57
59
PreferWaitForRule &
Original file line number Diff line number Diff line change
1
+ import type { RuleConfig } from '../rule-config' ;
2
+
3
+ /**
4
+ * Option.
5
+ */
6
+ export interface PreferQueryMatchersOption {
7
+ validEntries ?: {
8
+ query ?: 'get' | 'query' ;
9
+ matcher ?: string ;
10
+ [ k : string ] : any ;
11
+ } [ ] ;
12
+ }
13
+
14
+ /**
15
+ * Options.
16
+ */
17
+ export type PreferQueryMatchersOptions = [ PreferQueryMatchersOption ?] ;
18
+
19
+ /**
20
+ * Ensure the configured `get*`/`query*` query is used with the corresponding matchers.
21
+ *
22
+ * @see [prefer-query-matchers](https://github.com/testing-library/eslint-plugin-testing-library/tree/main/docs/rules/prefer-query-matchers.md)
23
+ */
24
+ export type PreferQueryMatchersRuleConfig =
25
+ RuleConfig < PreferQueryMatchersOptions > ;
26
+
27
+ /**
28
+ * Ensure the configured `get*`/`query*` query is used with the corresponding matchers.
29
+ *
30
+ * @see [prefer-query-matchers](https://github.com/testing-library/eslint-plugin-testing-library/tree/main/docs/rules/prefer-query-matchers.md)
31
+ */
32
+ export interface PreferQueryMatchersRule {
33
+ /**
34
+ * Ensure the configured `get*`/`query*` query is used with the corresponding matchers.
35
+ *
36
+ * @see [prefer-query-matchers](https://github.com/testing-library/eslint-plugin-testing-library/tree/main/docs/rules/prefer-query-matchers.md)
37
+ */
38
+ 'testing-library/prefer-query-matchers' : PreferQueryMatchersRuleConfig ;
39
+ }
You can’t perform that action at this time.
0 commit comments