Skip to content

Commit 21504bf

Browse files
authored
feat(no-manual-cleanup): enable by default in React and Vue (#659)
feat: enable no-manual-cleanup in React/Vue BREAKING CHANGE: enable no-manual-cleanup by default in React and Vue
1 parent 1c7be3b commit 21504bf

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ To enable this configuration use the `extends` property in your
216216
| [`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][] |
217217
| [`no-dom-import`](./docs/rules/no-dom-import.md) | Disallow importing from DOM Testing Library | 🔧 | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |
218218
| [`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 | 🔧 | |
219-
| [`no-manual-cleanup`](./docs/rules/no-manual-cleanup.md) | Disallow the use of `cleanup` | | |
219+
| [`no-manual-cleanup`](./docs/rules/no-manual-cleanup.md) | Disallow the use of `cleanup` | | ![react-badge][] ![vue-badge][] |
220220
| [`no-node-access`](./docs/rules/no-node-access.md) | Disallow direct Node access | | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |
221221
| [`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][] |
222222
| [`no-render-in-lifecycle`](./docs/rules/no-render-in-lifecycle.md) | Disallow the use of `render` in testing frameworks setup functions | | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |

lib/configs/react.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export = {
1111
'testing-library/no-container': 'error',
1212
'testing-library/no-debugging-utils': 'error',
1313
'testing-library/no-dom-import': ['error', 'react'],
14+
'testing-library/no-manual-cleanup': 'error',
1415
'testing-library/no-node-access': 'error',
1516
'testing-library/no-promise-in-fire-event': 'error',
1617
'testing-library/no-render-in-lifecycle': 'error',

lib/configs/vue.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export = {
1212
'testing-library/no-container': 'error',
1313
'testing-library/no-debugging-utils': 'error',
1414
'testing-library/no-dom-import': ['error', 'vue'],
15+
'testing-library/no-manual-cleanup': 'error',
1516
'testing-library/no-node-access': 'error',
1617
'testing-library/no-promise-in-fire-event': 'error',
1718
'testing-library/no-render-in-lifecycle': 'error',

lib/rules/no-manual-cleanup.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export default createTestingLibraryRule<Options, MessageIds>({
2828
recommendedConfig: {
2929
dom: false,
3030
angular: false,
31-
react: false,
32-
vue: false,
31+
react: 'error',
32+
vue: 'error',
3333
marko: false,
3434
},
3535
},

tests/__snapshots__/index.test.ts.snap

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Object {
9393
"error",
9494
"react",
9595
],
96+
"testing-library/no-manual-cleanup": "error",
9697
"testing-library/no-node-access": "error",
9798
"testing-library/no-promise-in-fire-event": "error",
9899
"testing-library/no-render-in-lifecycle": "error",
@@ -123,6 +124,7 @@ Object {
123124
"error",
124125
"vue",
125126
],
127+
"testing-library/no-manual-cleanup": "error",
126128
"testing-library/no-node-access": "error",
127129
"testing-library/no-promise-in-fire-event": "error",
128130
"testing-library/no-render-in-lifecycle": "error",

0 commit comments

Comments
 (0)