diff --git a/README.md b/README.md index e37f89e4..a0ca5920 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Then configure the rules you want to use within `rules` property of your `.eslin ```json { "rules": { - "testing-library/await-async-query": "error", + "testing-library/await-async-queries": "error", "testing-library/no-await-sync-queries": "error", "testing-library/no-debugging-utils": "warn", "testing-library/no-dom-import": "off" @@ -207,7 +207,7 @@ To enable this configuration use the `extends` property in your | Name | Description | 🔧 | Included in configurations | | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- | --- | ---------------------------------------------------------------------------------- | | [`await-async-event`](./docs/rules/await-async-event.md) | Enforce promises from async event methods are handled | 🔧 | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | -| [`await-async-query`](./docs/rules/await-async-query.md) | Enforce promises from async queries to be handled | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | +| [`await-async-queries`](./docs/rules/await-async-queries.md) | Enforce promises from async queries to be handled | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | [`await-async-utils`](./docs/rules/await-async-utils.md) | Enforce promises from async utils to be awaited properly | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | [`consistent-data-testid`](./docs/rules/consistent-data-testid.md) | Ensures consistent usage of `data-testid` | | | | [`no-await-sync-events`](./docs/rules/no-await-sync-events.md) | Disallow unnecessary `await` for sync events | | ![dom-badge][] ![angular-badge][] ![react-badge][] | diff --git a/docs/rules/await-async-query.md b/docs/rules/await-async-queries.md similarity index 98% rename from docs/rules/await-async-query.md rename to docs/rules/await-async-queries.md index 70e83aaf..8819ed7c 100644 --- a/docs/rules/await-async-query.md +++ b/docs/rules/await-async-queries.md @@ -1,4 +1,4 @@ -# Enforce promises from async queries to be handled (`testing-library/await-async-query`) +# Enforce promises from async queries to be handled (`testing-library/await-async-queries`) Ensure that promises returned by async queries are handled properly. diff --git a/lib/configs/angular.ts b/lib/configs/angular.ts index de23cedc..0e6f9774 100644 --- a/lib/configs/angular.ts +++ b/lib/configs/angular.ts @@ -9,7 +9,7 @@ export = { 'error', { eventModule: 'userEvent' }, ], - 'testing-library/await-async-query': 'error', + 'testing-library/await-async-queries': 'error', 'testing-library/await-async-utils': 'error', 'testing-library/no-await-sync-events': 'error', 'testing-library/no-await-sync-queries': 'error', diff --git a/lib/configs/dom.ts b/lib/configs/dom.ts index 4360414a..e46afbe0 100644 --- a/lib/configs/dom.ts +++ b/lib/configs/dom.ts @@ -9,7 +9,7 @@ export = { 'error', { eventModule: 'userEvent' }, ], - 'testing-library/await-async-query': 'error', + 'testing-library/await-async-queries': 'error', 'testing-library/await-async-utils': 'error', 'testing-library/no-await-sync-events': 'error', 'testing-library/no-await-sync-queries': 'error', diff --git a/lib/configs/marko.ts b/lib/configs/marko.ts index 735a76a0..7a7abdd2 100644 --- a/lib/configs/marko.ts +++ b/lib/configs/marko.ts @@ -9,7 +9,7 @@ export = { 'error', { eventModule: ['fireEvent', 'userEvent'] }, ], - 'testing-library/await-async-query': 'error', + 'testing-library/await-async-queries': 'error', 'testing-library/await-async-utils': 'error', 'testing-library/no-await-sync-queries': 'error', 'testing-library/no-container': 'error', diff --git a/lib/configs/react.ts b/lib/configs/react.ts index 8d766247..4d483ad7 100644 --- a/lib/configs/react.ts +++ b/lib/configs/react.ts @@ -9,7 +9,7 @@ export = { 'error', { eventModule: 'userEvent' }, ], - 'testing-library/await-async-query': 'error', + 'testing-library/await-async-queries': 'error', 'testing-library/await-async-utils': 'error', 'testing-library/no-await-sync-events': 'error', 'testing-library/no-await-sync-queries': 'error', diff --git a/lib/configs/vue.ts b/lib/configs/vue.ts index 78ce9cf4..faa0f61c 100644 --- a/lib/configs/vue.ts +++ b/lib/configs/vue.ts @@ -9,7 +9,7 @@ export = { 'error', { eventModule: ['fireEvent', 'userEvent'] }, ], - 'testing-library/await-async-query': 'error', + 'testing-library/await-async-queries': 'error', 'testing-library/await-async-utils': 'error', 'testing-library/no-await-sync-queries': 'error', 'testing-library/no-container': 'error', diff --git a/lib/rules/await-async-query.ts b/lib/rules/await-async-queries.ts similarity index 98% rename from lib/rules/await-async-query.ts rename to lib/rules/await-async-queries.ts index 0af105a5..f719362d 100644 --- a/lib/rules/await-async-query.ts +++ b/lib/rules/await-async-queries.ts @@ -10,7 +10,7 @@ import { isPromiseHandled, } from '../node-utils'; -export const RULE_NAME = 'await-async-query'; +export const RULE_NAME = 'await-async-queries'; export type MessageIds = 'asyncQueryWrapper' | 'awaitAsyncQuery'; type Options = []; diff --git a/tests/__snapshots__/index.test.ts.snap b/tests/__snapshots__/index.test.ts.snap index ccaa271a..5304da46 100644 --- a/tests/__snapshots__/index.test.ts.snap +++ b/tests/__snapshots__/index.test.ts.snap @@ -13,7 +13,7 @@ Object { "eventModule": "userEvent", }, ], - "testing-library/await-async-query": "error", + "testing-library/await-async-queries": "error", "testing-library/await-async-utils": "error", "testing-library/no-await-sync-events": "error", "testing-library/no-await-sync-queries": "error", @@ -49,7 +49,7 @@ Object { "eventModule": "userEvent", }, ], - "testing-library/await-async-query": "error", + "testing-library/await-async-queries": "error", "testing-library/await-async-utils": "error", "testing-library/no-await-sync-events": "error", "testing-library/no-await-sync-queries": "error", @@ -80,7 +80,7 @@ Object { ], }, ], - "testing-library/await-async-query": "error", + "testing-library/await-async-queries": "error", "testing-library/await-async-utils": "error", "testing-library/no-await-sync-queries": "error", "testing-library/no-container": "error", @@ -116,7 +116,7 @@ Object { "eventModule": "userEvent", }, ], - "testing-library/await-async-query": "error", + "testing-library/await-async-queries": "error", "testing-library/await-async-utils": "error", "testing-library/no-await-sync-events": "error", "testing-library/no-await-sync-queries": "error", @@ -157,7 +157,7 @@ Object { ], }, ], - "testing-library/await-async-query": "error", + "testing-library/await-async-queries": "error", "testing-library/await-async-utils": "error", "testing-library/no-await-sync-queries": "error", "testing-library/no-container": "error", diff --git a/tests/lib/rules/await-async-query.test.ts b/tests/lib/rules/await-async-queries.test.ts similarity index 99% rename from tests/lib/rules/await-async-query.test.ts rename to tests/lib/rules/await-async-queries.test.ts index 8054035a..8cf3819c 100644 --- a/tests/lib/rules/await-async-query.test.ts +++ b/tests/lib/rules/await-async-queries.test.ts @@ -1,6 +1,6 @@ import { TSESLint } from '@typescript-eslint/utils'; -import rule, { RULE_NAME } from '../../../lib/rules/await-async-query'; +import rule, { RULE_NAME } from '../../../lib/rules/await-async-queries'; import { ASYNC_QUERIES_COMBINATIONS, ASYNC_QUERIES_VARIANTS,