0

I have an eslint rule that will throw an error if there’s a console.log.

I’d like to create a handler called “Console.log” that does the same thing but won’t be picked up by the eslint rule.

Is there a way to make this globally available in a react project without having to import it anywhere?

Noob
  • 754
  • 3
  • 10
  • 27
  • 2
    Wouldn't it be easier to change the rule? – Gryxs Aug 26 '21 at 15:44
  • I believe this is the most appropriate way to solve it as well https://stackoverflow.com/a/34215651/16732460 – iunfixit Aug 26 '21 at 15:49
  • @iunfixit this will just allow console logs throughout the project. I only want to allow a couple console logs – Noob Aug 26 '21 at 17:58
  • You can manually allow some console logs with `// eslint-disable-next-line no-console`, a custom handler would create the same problem as with the normal log – iunfixit Aug 26 '21 at 18:35

0 Answers0