ni / javascript-styleguide

JavaScript and TypeScript Style Guide
MIT License
9 stars 9 forks source link

Disable no-console for Playwright ruleset #124

Open jattasNI opened 1 year ago

jattasNI commented 1 year ago

Currently, the Playwright ruleset inherits the TS/JS ruleset configuration for no-console which disallows using console.log.

It is suppressed in many places, including:

  1. acceptance-tests which want to log their state or an error
  2. custom reporters that want to log errors
  3. loggers in Performance and End2End tests

What is our recommendation for using console within Playwright code? Can we disable this rule or come up with an alternate suggestion?

jattasNI commented 1 year ago

In discussion today we realized:

  1. this isn't a playwright issue, it's a Node server-side code issue
  2. we shouldn't change our ruleset generally
  3. it is ok (encouraged!) to do logging in server code (and maybe also in some situations in test code, though most instances we found seemed suspicious) but that should be done via a centralized logging service, not console

The action item for this issue is to update our docs for this rule.