Home / File/ no-production-logging-test.internal.js — react Source File

no-production-logging-test.internal.js — react Source File

Architecture documentation for no-production-logging-test.internal.js, a javascript file in the react codebase.

Entity Profile

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @emails react-core
 */

'use strict';

const rule = require('../no-production-logging');
const {RuleTester} = require('eslint');
const ruleTester = new RuleTester();

ruleTester.run('no-production-logging', rule, {
  valid: [
    {
      code: `
        if (__DEV__) {
          console.error('Oh no');
        }
      `,
    },
    {
      code: `
        if (__DEV__) {
          console.error('Hello %s', foo)
        }
      `,
    },
    {
      code: `
        if (__DEV__) {
          console.error('Hello %s %s', foo, bar)
        }
      `,
    },
    {
      code: `
        if (__DEV__) {
          console.warn('Oh no');
        }
      `,
    },
    {
      code: `
        if (__DEV__) {
          console.warn('Oh no');
        }
      `,
    },
    // This is OK too because it's wrapped outside:
    {
      code: `
        if (__DEV__) {
          if (potato) {
            while (true) {
              console.error('Oh no');
            }
// ... (235 more lines)

Frequently Asked Questions

What does no-production-logging-test.internal.js do?
no-production-logging-test.internal.js is a source file in the react codebase, written in javascript.
Where is no-production-logging-test.internal.js in the architecture?
no-production-logging-test.internal.js is located at scripts/eslint-rules/__tests__/no-production-logging-test.internal.js (directory: scripts/eslint-rules/__tests__).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free