Skip to content

Commit

Permalink
feat(no-global-regexp-flag-in-query): add to all configs by default (#…
Browse files Browse the repository at this point in the history
…660)

BREAKING CHANGE: `no-global-regexp-flag-in-query` is now enabled by default in all configs
  • Loading branch information
skovy authored and MichaelDeBoey committed Oct 4, 2022
1 parent 8f6ebf5 commit c76a7bf
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -215,7 +215,7 @@ To enable this configuration use the `extends` property in your
| [`no-container`](./docs/rules/no-container.md) | Disallow the use of `container` methods | | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |
| [`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][] |
| [`no-dom-import`](./docs/rules/no-dom-import.md) | Disallow importing from DOM Testing Library | 🔧 | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |
| [`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 | 🔧 | |
| [`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 | 🔧 | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |
| [`no-manual-cleanup`](./docs/rules/no-manual-cleanup.md) | Disallow the use of `cleanup` | | ![react-badge][] ![vue-badge][] |
| [`no-node-access`](./docs/rules/no-node-access.md) | Disallow direct Node access | | ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |
| [`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][] |
Expand Down
1 change: 1 addition & 0 deletions lib/configs/angular.ts
Expand Up @@ -11,6 +11,7 @@ export = {
'testing-library/no-container': 'error',
'testing-library/no-debugging-utils': 'error',
'testing-library/no-dom-import': ['error', 'angular'],
'testing-library/no-global-regexp-flag-in-query': 'error',
'testing-library/no-node-access': 'error',
'testing-library/no-promise-in-fire-event': 'error',
'testing-library/no-render-in-lifecycle': 'error',
Expand Down
1 change: 1 addition & 0 deletions lib/configs/dom.ts
Expand Up @@ -8,6 +8,7 @@ export = {
'testing-library/await-async-query': 'error',
'testing-library/await-async-utils': 'error',
'testing-library/no-await-sync-query': 'error',
'testing-library/no-global-regexp-flag-in-query': 'error',
'testing-library/no-promise-in-fire-event': 'error',
'testing-library/no-wait-for-empty-callback': 'error',
'testing-library/no-wait-for-multiple-assertions': 'error',
Expand Down
1 change: 1 addition & 0 deletions lib/configs/marko.ts
Expand Up @@ -12,6 +12,7 @@ export = {
'testing-library/no-container': 'error',
'testing-library/no-debugging-utils': 'error',
'testing-library/no-dom-import': ['error', 'marko'],
'testing-library/no-global-regexp-flag-in-query': 'error',
'testing-library/no-node-access': 'error',
'testing-library/no-promise-in-fire-event': 'error',
'testing-library/no-render-in-lifecycle': 'error',
Expand Down
1 change: 1 addition & 0 deletions lib/configs/react.ts
Expand Up @@ -11,6 +11,7 @@ export = {
'testing-library/no-container': 'error',
'testing-library/no-debugging-utils': 'error',
'testing-library/no-dom-import': ['error', 'react'],
'testing-library/no-global-regexp-flag-in-query': 'error',
'testing-library/no-manual-cleanup': 'error',
'testing-library/no-node-access': 'error',
'testing-library/no-promise-in-fire-event': 'error',
Expand Down
1 change: 1 addition & 0 deletions lib/configs/vue.ts
Expand Up @@ -12,6 +12,7 @@ export = {
'testing-library/no-container': 'error',
'testing-library/no-debugging-utils': 'error',
'testing-library/no-dom-import': ['error', 'vue'],
'testing-library/no-global-regexp-flag-in-query': 'error',
'testing-library/no-manual-cleanup': 'error',
'testing-library/no-node-access': 'error',
'testing-library/no-promise-in-fire-event': 'error',
Expand Down
10 changes: 5 additions & 5 deletions lib/rules/no-global-regexp-flag-in-query.ts
Expand Up @@ -21,11 +21,11 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description: 'Disallow the use of the global RegExp flag (/g) in queries',
recommendedConfig: {
dom: false,
angular: false,
react: false,
vue: false,
marko: false,
dom: 'error',
angular: 'error',
react: 'error',
vue: 'error',
marko: 'error',
},
},
messages: {
Expand Down
5 changes: 5 additions & 0 deletions tests/__snapshots__/index.test.ts.snap
Expand Up @@ -16,6 +16,7 @@ Object {
"error",
"angular",
],
"testing-library/no-global-regexp-flag-in-query": "error",
"testing-library/no-node-access": "error",
"testing-library/no-promise-in-fire-event": "error",
"testing-library/no-render-in-lifecycle": "error",
Expand All @@ -38,6 +39,7 @@ Object {
"testing-library/await-async-query": "error",
"testing-library/await-async-utils": "error",
"testing-library/no-await-sync-query": "error",
"testing-library/no-global-regexp-flag-in-query": "error",
"testing-library/no-promise-in-fire-event": "error",
"testing-library/no-wait-for-empty-callback": "error",
"testing-library/no-wait-for-multiple-assertions": "error",
Expand All @@ -64,6 +66,7 @@ Object {
"error",
"marko",
],
"testing-library/no-global-regexp-flag-in-query": "error",
"testing-library/no-node-access": "error",
"testing-library/no-promise-in-fire-event": "error",
"testing-library/no-render-in-lifecycle": "error",
Expand Down Expand Up @@ -93,6 +96,7 @@ Object {
"error",
"react",
],
"testing-library/no-global-regexp-flag-in-query": "error",
"testing-library/no-manual-cleanup": "error",
"testing-library/no-node-access": "error",
"testing-library/no-promise-in-fire-event": "error",
Expand Down Expand Up @@ -124,6 +128,7 @@ Object {
"error",
"vue",
],
"testing-library/no-global-regexp-flag-in-query": "error",
"testing-library/no-manual-cleanup": "error",
"testing-library/no-node-access": "error",
"testing-library/no-promise-in-fire-event": "error",
Expand Down

0 comments on commit c76a7bf

Please sign in to comment.