Skip to content

Enable `no-console` ESLint rule

Created by: valerybugakov

Problem statement

Enable no-console ESLint rule

Success criteria

  1. no-console is set to error in the monorepo eslintrc.
  2. no-console is disabled for server-side code (e.g., client/web/dev or gulpfile.js) and Storybook stories via eslintrc overrides field.
  3. no-console is disabled for browser and VSCode packages in their eslintrc configs.
  4. 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)
    }
  5. console.error() calls are replaced with the new logError utility function.
  6. console.log() calls are removed or replaced with the new logError utility function.

Time estimate

  • This task should take 3 hours at maximum. Ping the reviewer in the spec pull request if time-consuming changes are required.