Skip to content

[SG-39797] Enable no-console ESLint rule

Warren Gifford requested to merge contractors/SG-39797 into main

Created by: gitstart-sourcegraph

Description

Enable no-console ESLint rule

Success Criteria

  • no-console is set to error in the monorepo eslintrc.
  • no-console is disabled for server-side code (e.g., client/web/dev or gulpfile.js) and Storybook stories via eslintrc overrides field.
  • no-console is disabled for browser and VSCode packages in their eslintrc configs.
  • The new logError utility function is added to the @sourcegraph/common package.
export function logError(...args: unknown[]): void {
    // eslint-disable-next-line no-console
    console.error(...args)
}
  • console.error() calls are replaced with the new logError utility function.
  • console.log() calls are removed or replaced with the new logError utility function.

Refs

Test plan

Ensure no console.log or console.error is used in any files except files in the

  • browser and VSCode packages
  • storybook stories
  • client/web/dev or gulpfile.js

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading