Skip to content

Commit 8cabce9

Browse files
committed
feat(no-debug): rename to no-debugging-utils
1 parent 3383e9f commit 8cabce9

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

CONTRIBUTING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If you ever need to update a snapshot, you can run `npm run test:update`
4444
4545
Based on [ESLint's Rule Naming Conventions](https://eslint.org/docs/developer-guide/working-with-rules#rule-naming-conventions), you must follow these rules:
4646
47-
- If your rule is disallowing something, prefix it with `no-` such as `no-debug`
47+
- If your rule is disallowing something, prefix it with `no-` such as `no-debugging-utils`
4848
for disallowing `debug()`.
4949
- If your rule is suggesting to prefer a way of doing something, among other ways, you can **optionally** prefix it with
5050
`prefer-`. For example, `prefer-screen-queries` suggests to use `screen.getByText()` from imported `screen` rather
@@ -57,11 +57,11 @@ Based on [ESLint's Rule Naming Conventions](https://eslint.org/docs/developer-gu
5757
## Adding new rules
5858
5959
In the [same way as ESLint](https://eslint.org/docs/developer-guide/working-with-rules),
60-
each rule has three files named with its identifier (e.g. `no-debug`):
60+
each rule has three files named with its identifier (e.g. `no-debugging-utils`):
6161
62-
- in the `lib/rules` directory: a source file (e.g. `no-debug.ts`)
63-
- in the `tests/lib/rules` directory: a test file (e.g. `no-debug.ts`)
64-
- in the `docs/rules` directory: a Markdown documentation file (e.g. `no-debug.md`)
62+
- in the `lib/rules` directory: a source file (e.g. `no-debugging-utils.ts`)
63+
- in the `tests/lib/rules` directory: a test file (e.g. `no-debugging-utils.ts`)
64+
- in the `docs/rules` directory: a Markdown documentation file (e.g. `no-debugging-utils.md`)
6565
6666
Additionally, you need to do a couple of extra things:
6767

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Then configure the rules you want to use within `rules` property of your `.eslin
6666
"rules": {
6767
"testing-library/await-async-query": "error",
6868
"testing-library/no-await-sync-query": "error",
69-
"testing-library/no-debug": "warn",
69+
"testing-library/no-debugging-utils": "warn",
7070
"testing-library/no-dom-import": "off"
7171
}
7272
}
@@ -193,7 +193,7 @@ To enable this configuration use the `extends` property in your
193193
| [`testing-library/no-await-sync-events`](./docs/rules/no-await-sync-events.md) | Disallow unnecessary `await` for sync events | | |
194194
| [`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][] |
195195
| [`testing-library/no-container`](./docs/rules/no-container.md) | Disallow the use of `container` methods | | ![angular-badge][] ![react-badge][] ![vue-badge][] |
196-
| [`testing-library/no-debug`](./docs/rules/no-debug.md) | Disallow the use of debugging utilities like `debug` | | ![angular-badge][] ![react-badge][] ![vue-badge][] |
196+
| [`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][] |
197197
| [`testing-library/no-dom-import`](./docs/rules/no-dom-import.md) | Disallow importing from DOM Testing Library | 🔧 | ![angular-badge][] ![react-badge][] ![vue-badge][] |
198198
| [`testing-library/no-manual-cleanup`](./docs/rules/no-manual-cleanup.md) | Disallow the use of `cleanup` | | |
199199
| [`testing-library/no-node-access`](./docs/rules/no-node-access.md) | Disallow direct Node access | | ![angular-badge][] ![react-badge][] ![vue-badge][] |

docs/rules/no-debug.md renamed to docs/rules/no-debugging-utils.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Disallow the use of debugging utilities like `debug` (`testing-library/no-debug`)
1+
# Disallow the use of debugging utilities (`testing-library/no-debugging-utils`)
22

33
Just like `console.log` statements pollutes the browser's output, debug statements also pollutes the tests if one of your teammates forgot to remove it. `debug` statements should be used when you actually want to debug your tests but should not be pushed to the codebase.
44

@@ -41,7 +41,7 @@ You can control which debugging utils are checked for with the `utilsToCheckFor`
4141

4242
```json
4343
{
44-
"testing-library/no-debug": [
44+
"testing-library/no-debugging-utils": [
4545
"error",
4646
{
4747
"utilsToCheckFor": {

lib/configs/angular.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export = {
99
'testing-library/await-async-utils': 'error',
1010
'testing-library/no-await-sync-query': 'error',
1111
'testing-library/no-container': 'error',
12-
'testing-library/no-debug': 'error',
12+
'testing-library/no-debugging-utils': 'error',
1313
'testing-library/no-dom-import': ['error', 'angular'],
1414
'testing-library/no-node-access': 'error',
1515
'testing-library/no-promise-in-fire-event': 'error',

lib/configs/react.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export = {
99
'testing-library/await-async-utils': 'error',
1010
'testing-library/no-await-sync-query': 'error',
1111
'testing-library/no-container': 'error',
12-
'testing-library/no-debug': 'error',
12+
'testing-library/no-debugging-utils': 'error',
1313
'testing-library/no-dom-import': ['error', 'react'],
1414
'testing-library/no-node-access': 'error',
1515
'testing-library/no-promise-in-fire-event': 'error',

lib/configs/vue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export = {
1010
'testing-library/await-fire-event': 'error',
1111
'testing-library/no-await-sync-query': 'error',
1212
'testing-library/no-container': 'error',
13-
'testing-library/no-debug': 'error',
13+
'testing-library/no-debugging-utils': 'error',
1414
'testing-library/no-dom-import': ['error', 'vue'],
1515
'testing-library/no-node-access': 'error',
1616
'testing-library/no-promise-in-fire-event': 'error',

lib/rules/no-debug.ts renamed to lib/rules/no-debugging-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type DebugUtilsToCheckFor = Partial<
2121
Record<typeof DEBUG_UTILS[number], boolean>
2222
>;
2323

24-
export const RULE_NAME = 'no-debug';
24+
export const RULE_NAME = 'no-debugging-utils';
2525
export type MessageIds = 'noDebug';
2626
type Options = [{ utilsToCheckFor?: DebugUtilsToCheckFor }];
2727

tests/__snapshots__/index.test.ts.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Object {
1111
"testing-library/await-async-utils": "error",
1212
"testing-library/no-await-sync-query": "error",
1313
"testing-library/no-container": "error",
14-
"testing-library/no-debug": "error",
14+
"testing-library/no-debugging-utils": "error",
1515
"testing-library/no-dom-import": Array [
1616
"error",
1717
"angular",
@@ -47,7 +47,7 @@ Object {
4747
"testing-library/await-async-utils": "error",
4848
"testing-library/no-await-sync-query": "error",
4949
"testing-library/no-container": "error",
50-
"testing-library/no-debug": "error",
50+
"testing-library/no-debugging-utils": "error",
5151
"testing-library/no-dom-import": Array [
5252
"error",
5353
"react",
@@ -70,7 +70,7 @@ Object {
7070
"testing-library/await-fire-event": "error",
7171
"testing-library/no-await-sync-query": "error",
7272
"testing-library/no-container": "error",
73-
"testing-library/no-debug": "error",
73+
"testing-library/no-debugging-utils": "error",
7474
"testing-library/no-dom-import": Array [
7575
"error",
7676
"vue",

tests/lib/rules/no-debug.test.ts renamed to tests/lib/rules/no-debugging-utils.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import rule, { RULE_NAME } from '../../../lib/rules/no-debug';
1+
import rule, { RULE_NAME } from '../../../lib/rules/no-debugging-utils';
22
import { createRuleTester } from '../test-utils';
33

44
const ruleTester = createRuleTester();

0 commit comments

Comments
 (0)