Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-debug also affects log.debug() custom logger #845

Open
gkiely opened this issue Nov 28, 2023 · 1 comment
Open

no-debug also affects log.debug() custom logger #845

gkiely opened this issue Nov 28, 2023 · 1 comment
Labels
awaiting response Waiting for a reply from the OP question Further information is requested

Comments

@gkiely
Copy link

gkiely commented Nov 28, 2023

Have you read the Troubleshooting section?

Yes

Plugin version

6.2.0

ESLint version

8.54.0

Node.js version

20.2.0

package manager and version

9.6.6

Operating system

macOS Monterey, 12.7

Bug description

Using a logger in my code, specifically log.debug('')

Steps to reproduce

  1. Set up eslint-plugin-testing-library
  2. import or write a logger library that uses log.debug (example)
  3. type log.debug()
  4. Error will fire when linting

Error output/screenshots

error Unexpected debug statement testing-library/no-debugging-utils

ESLint configuration

{
  "env": {
    "shared-node-browser": true,
    "es2022": true
  },
  "ignorePatterns": ["src/app/index.css", "public"],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": "latest",
    "tsconfigRootDir": ".",
    "project": ["./tsconfig.json", "./tsconfig.node.json"]
  },
  "settings": {
    "react": {
      "version": "detect"
    }
  },
  "plugins": ["testing-library"],
  "testing-library/no-debugging-utils": "error",
}

Rule(s) affected

testing-library/no-debugging-utils

Anything else?

Ideally it would only affect .debug() or when it is using screen or a testing-library helper method.
Alternatively having an option to be able to limit it to screen.debug() would also suffice

Do you want to submit a pull request to fix this bug?

Yes

@gkiely gkiely added bug Something isn't working triage Pending to be triaged by a maintainer labels Nov 28, 2023
@Belco90
Copy link
Member

Belco90 commented Jan 14, 2024

Hey @gkiely! This is related to Aggressive Reporting. Have you checked the Troubleshooting section to find more about restricting this behavior?

@Belco90 Belco90 added question Further information is requested awaiting response Waiting for a reply from the OP and removed bug Something isn't working triage Pending to be triaged by a maintainer labels Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Waiting for a reply from the OP question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants