Skip to content

feat: add no-debug #6

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

Merged
merged 2 commits into from
Sep 20, 2019
Merged

feat: add no-debug #6

merged 2 commits into from
Sep 20, 2019

Conversation

thomaslombart
Copy link
Collaborator

This PR intends to add a new rule called no-debug.

Indeed, just like console.log statements pollutes the browser's output, debug statements can also pollute the tests:

import React from 'react'
import { render } from '@testing-library/react'

const HelloWorld = () => <h1>Hello World</h1>
const { debug } = render(<HelloWorld />)
debug()
// <div>
//   <h1>Hello World</h1>
// </div>

This rule would prevent developers to push unwanted debug statements to the codebase by warning them that it has been used.

@thomaslombart thomaslombart self-assigned this Sep 20, 2019
description: 'Disallow unnecessary debug usages in the tests',
category: 'Best Practices',
recommended: true,
url: 'TODO',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already have getDocsUrl to handle this so please add corresponding URL

@Belco90 Belco90 merged commit 7643d5a into master Sep 20, 2019
@Belco90 Belco90 deleted the feature/no-debug branch September 20, 2019 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants