eslint-plugin-testing-library
Advanced tools
Comparing version 5.4.0 to 5.5.0
{ | ||
"name": "eslint-plugin-testing-library", | ||
"version": "5.4.0", | ||
"version": "5.5.0", | ||
"description": "ESLint rules for Testing Library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -182,2 +182,15 @@ <div align="center"> | ||
### Marko | ||
Enforces recommended rules for Marko Testing Library. | ||
To enable this configuration use the `extends` property in your | ||
`.eslintrc` config file: | ||
```json | ||
{ | ||
"extends": ["plugin:testing-library/marko"] | ||
} | ||
``` | ||
## Supported Rules | ||
@@ -189,33 +202,33 @@ | ||
**Configurations**: ![dom-badge][] = dom, ![angular-badge][] = angular, ![react-badge][] = react, ![vue-badge][] = vue | ||
**Configurations**: ![dom-badge][] = dom, ![angular-badge][] = angular, ![react-badge][] = react, ![vue-badge][] = vue, ![marko-badge][] = marko | ||
| Name | Description | 🔧 | Included in configurations | | ||
| ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------------------- | | ||
| [`testing-library/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][] | | ||
| [`testing-library/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][] | | ||
| [`testing-library/await-fire-event`](./docs/rules/await-fire-event.md) | Enforce promises from `fireEvent` methods to be handled | | ![vue-badge][] | | ||
| [`testing-library/consistent-data-testid`](./docs/rules/consistent-data-testid.md) | Ensures consistent usage of `data-testid` | | | | ||
| [`testing-library/no-await-sync-events`](./docs/rules/no-await-sync-events.md) | Disallow unnecessary `await` for sync events | | | | ||
| [`testing-library/no-await-sync-query`](./docs/rules/no-await-sync-query.md) | Disallow unnecessary `await` for sync queries | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-container`](./docs/rules/no-container.md) | Disallow the use of `container` methods | | ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-debugging-utils`](./docs/rules/no-debugging-utils.md) | Disallow the use of debugging utilities like `debug` | | ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-dom-import`](./docs/rules/no-dom-import.md) | Disallow importing from DOM Testing Library | 🔧 | ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-global-regexp-flag-in-query`](./docs/rules/no-global-regexp-flag-in-query.md) | Disallow the use of the global RegExp flag (/g) in queries | 🔧 | | | ||
| [`testing-library/no-manual-cleanup`](./docs/rules/no-manual-cleanup.md) | Disallow the use of `cleanup` | | | | ||
| [`testing-library/no-node-access`](./docs/rules/no-node-access.md) | Disallow direct Node access | | ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-promise-in-fire-event`](./docs/rules/no-promise-in-fire-event.md) | Disallow the use of promises passed to a `fireEvent` method | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-render-in-setup`](./docs/rules/no-render-in-setup.md) | Disallow the use of `render` in testing frameworks setup functions | | ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-unnecessary-act`](./docs/rules/no-unnecessary-act.md) | Disallow wrapping Testing Library utils or empty callbacks in `act` | | ![react-badge][] | | ||
| [`testing-library/no-wait-for-empty-callback`](./docs/rules/no-wait-for-empty-callback.md) | Disallow empty callbacks for `waitFor` and `waitForElementToBeRemoved` | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-wait-for-multiple-assertions`](./docs/rules/no-wait-for-multiple-assertions.md) | Disallow the use of multiple `expect` calls inside `waitFor` | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-wait-for-side-effects`](./docs/rules/no-wait-for-side-effects.md) | Disallow the use of side effects in `waitFor` | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/no-wait-for-snapshot`](./docs/rules/no-wait-for-snapshot.md) | Ensures no snapshot is generated inside of a `waitFor` call | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/prefer-explicit-assert`](./docs/rules/prefer-explicit-assert.md) | Suggest using explicit assertions rather than standalone queries | | | | ||
| [`testing-library/prefer-find-by`](./docs/rules/prefer-find-by.md) | Suggest using `find(All)By*` query instead of `waitFor` + `get(All)By*` to wait for elements | 🔧 | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/prefer-presence-queries`](./docs/rules/prefer-presence-queries.md) | Ensure appropriate `get*`/`query*` queries are used with their respective matchers | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/prefer-query-by-disappearance`](./docs/rules/prefer-query-by-disappearance.md) | Suggest using `queryBy*` queries when waiting for disappearance | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/prefer-screen-queries`](./docs/rules/prefer-screen-queries.md) | Suggest using `screen` while querying | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| [`testing-library/prefer-user-event`](./docs/rules/prefer-user-event.md) | Suggest using `userEvent` over `fireEvent` for simulating user interactions | | | | ||
| [`testing-library/prefer-wait-for`](./docs/rules/prefer-wait-for.md) | Use `waitFor` instead of deprecated wait methods | 🔧 | | | ||
| [`testing-library/render-result-naming-convention`](./docs/rules/render-result-naming-convention.md) | Enforce a valid naming for return value from `render` | | ![angular-badge][] ![react-badge][] ![vue-badge][] | | ||
| Name | Description | 🔧 | Included in configurations | | ||
| ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | --- | ---------------------------------------------------------------------------------- | | ||
| [`testing-library/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][] | | ||
| [`testing-library/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][] | | ||
| [`testing-library/await-fire-event`](./docs/rules/await-fire-event.md) | Enforce promises from `fireEvent` methods to be handled | | ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/consistent-data-testid`](./docs/rules/consistent-data-testid.md) | Ensures consistent usage of `data-testid` | | | | ||
| [`testing-library/no-await-sync-events`](./docs/rules/no-await-sync-events.md) | Disallow unnecessary `await` for sync events | | | | ||
| [`testing-library/no-await-sync-query`](./docs/rules/no-await-sync-query.md) | Disallow unnecessary `await` for sync queries | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-container`](./docs/rules/no-container.md) | Disallow the use of `container` methods | | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-debugging-utils`](./docs/rules/no-debugging-utils.md) | Disallow the use of debugging utilities like `debug` | | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-dom-import`](./docs/rules/no-dom-import.md) | Disallow importing from DOM Testing Library | 🔧 | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-global-regexp-flag-in-query`](./docs/rules/no-global-regexp-flag-in-query.md) | Disallow the use of the global RegExp flag (/g) in queries | 🔧 | | | ||
| [`testing-library/no-manual-cleanup`](./docs/rules/no-manual-cleanup.md) | Disallow the use of `cleanup` | | | | ||
| [`testing-library/no-node-access`](./docs/rules/no-node-access.md) | Disallow direct Node access | | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-promise-in-fire-event`](./docs/rules/no-promise-in-fire-event.md) | Disallow the use of promises passed to a `fireEvent` method | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-render-in-setup`](./docs/rules/no-render-in-setup.md) | Disallow the use of `render` in testing frameworks setup functions | | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-unnecessary-act`](./docs/rules/no-unnecessary-act.md) | Disallow wrapping Testing Library utils or empty callbacks in `act` | | ![react-badge][] ![marko-badge][] | | ||
| [`testing-library/no-wait-for-empty-callback`](./docs/rules/no-wait-for-empty-callback.md) | Disallow empty callbacks for `waitFor` and `waitForElementToBeRemoved` | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-wait-for-multiple-assertions`](./docs/rules/no-wait-for-multiple-assertions.md) | Disallow the use of multiple `expect` calls inside `waitFor` | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-wait-for-side-effects`](./docs/rules/no-wait-for-side-effects.md) | Disallow the use of side effects in `waitFor` | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/no-wait-for-snapshot`](./docs/rules/no-wait-for-snapshot.md) | Ensures no snapshot is generated inside of a `waitFor` call | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/prefer-explicit-assert`](./docs/rules/prefer-explicit-assert.md) | Suggest using explicit assertions rather than standalone queries | | | | ||
| [`testing-library/prefer-find-by`](./docs/rules/prefer-find-by.md) | Suggest using `find(All)By*` query instead of `waitFor` + `get(All)By*` to wait for elements | 🔧 | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/prefer-presence-queries`](./docs/rules/prefer-presence-queries.md) | Ensure appropriate `get*`/`query*` queries are used with their respective matchers | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/prefer-query-by-disappearance`](./docs/rules/prefer-query-by-disappearance.md) | Suggest using `queryBy*` queries when waiting for disappearance | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/prefer-screen-queries`](./docs/rules/prefer-screen-queries.md) | Suggest using `screen` while querying | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
| [`testing-library/prefer-user-event`](./docs/rules/prefer-user-event.md) | Suggest using `userEvent` over `fireEvent` for simulating user interactions | | | | ||
| [`testing-library/prefer-wait-for`](./docs/rules/prefer-wait-for.md) | Use `waitFor` instead of deprecated wait methods | 🔧 | | | ||
| [`testing-library/render-result-naming-convention`](./docs/rules/render-result-naming-convention.md) | Enforce a valid naming for return value from `render` | | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] | | ||
@@ -425,1 +438,2 @@ <!-- RULES-LIST:END --> | ||
[vue-badge]: https://img.shields.io/badge/-Vue-black?style=flat-square&logo=vue.js&logoColor=white&labelColor=4FC08D&color=black | ||
[marko-badge]: https://img.shields.io/badge/-Marko-black?style=flat-square&logo=marko&logoColor=white&labelColor=2596BE&color=black |
@@ -19,2 +19,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -21,0 +22,0 @@ }, |
@@ -18,2 +18,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -20,0 +21,0 @@ }, |
@@ -19,2 +19,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -21,0 +22,0 @@ }, |
@@ -19,2 +19,3 @@ "use strict"; | ||
vue: false, | ||
marko: false, | ||
}, | ||
@@ -21,0 +22,0 @@ }, |
@@ -21,2 +21,3 @@ "use strict"; | ||
vue: false, | ||
marko: false, | ||
}, | ||
@@ -23,0 +24,0 @@ }, |
@@ -18,2 +18,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -20,0 +21,0 @@ }, |
@@ -19,2 +19,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -21,0 +22,0 @@ }, |
@@ -20,2 +20,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -22,0 +23,0 @@ }, |
@@ -22,2 +22,3 @@ "use strict"; | ||
vue: ['error', 'vue'], | ||
marko: ['error', 'marko'], | ||
}, | ||
@@ -40,3 +41,5 @@ }, | ||
if (framework) { | ||
const correctModuleName = moduleName.replace('dom', framework); | ||
const correctModuleName = framework === 'marko' | ||
? moduleName.replace('dom-', `@${framework}/`) | ||
: moduleName.replace('dom', framework); | ||
context.report({ | ||
@@ -43,0 +46,0 @@ node, |
@@ -19,2 +19,3 @@ "use strict"; | ||
vue: false, | ||
marko: false, | ||
}, | ||
@@ -21,0 +22,0 @@ }, |
@@ -20,2 +20,3 @@ "use strict"; | ||
vue: false, | ||
marko: false, | ||
}, | ||
@@ -22,0 +23,0 @@ }, |
@@ -19,2 +19,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -21,0 +22,0 @@ }, |
@@ -19,2 +19,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -21,0 +22,0 @@ }, |
@@ -35,2 +35,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -37,0 +38,0 @@ }, |
@@ -19,2 +19,3 @@ "use strict"; | ||
vue: false, | ||
marko: 'error', | ||
}, | ||
@@ -21,0 +22,0 @@ }, |
@@ -19,2 +19,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -21,0 +22,0 @@ }, |
@@ -18,2 +18,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -20,0 +21,0 @@ }, |
@@ -18,2 +18,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -20,0 +21,0 @@ }, |
@@ -20,2 +20,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -22,0 +23,0 @@ }, |
@@ -51,2 +51,3 @@ "use strict"; | ||
vue: false, | ||
marko: false, | ||
}, | ||
@@ -53,0 +54,0 @@ }, |
@@ -38,2 +38,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -40,0 +41,0 @@ }, |
@@ -17,2 +17,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -19,0 +20,0 @@ }, |
@@ -18,2 +18,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -20,0 +21,0 @@ }, |
@@ -30,2 +30,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -32,0 +33,0 @@ }, |
@@ -61,2 +61,3 @@ "use strict"; | ||
vue: false, | ||
marko: false, | ||
}, | ||
@@ -63,0 +64,0 @@ }, |
@@ -20,2 +20,3 @@ "use strict"; | ||
vue: false, | ||
marko: false, | ||
}, | ||
@@ -22,0 +23,0 @@ }, |
@@ -23,2 +23,3 @@ "use strict"; | ||
vue: 'error', | ||
marko: 'error', | ||
}, | ||
@@ -25,0 +26,0 @@ }, |
@@ -40,2 +40,3 @@ "use strict"; | ||
'@testing-library/svelte', | ||
'@marko/testing-library', | ||
]; | ||
@@ -42,0 +43,0 @@ exports.LIBRARY_MODULES = LIBRARY_MODULES; |
@@ -9,2 +9,3 @@ "use strict"; | ||
'vue', | ||
'marko', | ||
]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
229959
45
4094
437