Closed
Description
I love the no-debug
rule, however, it doesn't work if you're using a custom local library name in order to, for example, provide a custom render function to the rest of your code.
I agree that the library name is no longer @testing-library/react
, for example, and could be anything, so the rule doesn't find a match, but because customizing the render function is in the docs, and I presume quite standard practice, it makes this rule an immediate non-starter, which is a shame since the rule would be really nice to have.
Seems like the rule needs an option, similar to the existing renderFunctions
option, that we can use to specify the name of our import. In my case, it's import ... from 'testingUtility'
.
import { screen } from '@testing-library/react';
...
screen.debug(); // IS a lint error
however,
import { screen } from 'testingUtility';
...
screen.debug(); // is NOT a lint error -- and should be