Home / Function/ main() — react Function Reference

main() — react Function Reference

Architecture documentation for the main() function in index.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  3ea16214_1049_d19f_bc0a_1e69cd40b4bd["main()"]
  62c6ef48_b6c1_13e9_0d99_fe0a9fcba79a["index.ts"]
  3ea16214_1049_d19f_bc0a_1e69cd40b4bd -->|defined in| 62c6ef48_b6c1_13e9_0d99_fe0a9fcba79a
  style 3ea16214_1049_d19f_bc0a_1e69cd40b4bd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/react-compiler-healthcheck/src/index.ts lines 16–54

async function main() {
  const argv = yargs(process.argv.slice(2))
    .scriptName('healthcheck')
    .usage('$ npx healthcheck <src>')
    .option('src', {
      description: 'glob expression matching src files to compile',
      type: 'string',
      default: '**/+(*.{js,mjs,jsx,ts,tsx}|package.json)',
    })
    .parseSync();

  const spinner = ora('Checking').start();
  let src = argv.src;

  const globOptions = {
    onlyFiles: true,
    ignore: [
      '**/node_modules/**',
      '**/dist/**',
      '**/tests/**',
      '**/__tests__/**',
      '**/__mocks__/**',
      '**/__e2e__/**',
    ],
  };

  for (const path of await glob(src, globOptions)) {
    const source = await fs.readFile(path, 'utf-8');
    spinner.text = `Checking ${path}`;
    reactCompilerCheck.run(source, path);
    strictModeCheck.run(source, path);
    libraryCompatCheck.run(source, path);
  }
  spinner.stop();

  reactCompilerCheck.report();
  strictModeCheck.report();
  libraryCompatCheck.report();
}

Domain

Subdomains

Frequently Asked Questions

What does main() do?
main() is a function in the react codebase, defined in compiler/packages/react-compiler-healthcheck/src/index.ts.
Where is main() defined?
main() is defined in compiler/packages/react-compiler-healthcheck/src/index.ts at line 16.

Analyze Your Own Codebase

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

Try Supermodel Free