Home / Function/ format() — react Function Reference

format() — react Function Reference

Architecture documentation for the format() function in compiler.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  e280875d_a772_f261_3d24_55f4118e3e6d["format()"]
  f294d5ab_dd3b_6bca_e120_e970909a7dc8["compiler.ts"]
  e280875d_a772_f261_3d24_55f4118e3e6d -->|defined in| f294d5ab_dd3b_6bca_e120_e970909a7dc8
  34f68e46_4ab8_f2b5_b44f_59f14d4d25b8["transformFixtureInput()"]
  34f68e46_4ab8_f2b5_b44f_59f14d4d25b8 -->|calls| e280875d_a772_f261_3d24_55f4118e3e6d
  c38ea253_eaec_a82d_bbe8_28e45a28dbf6["runCompileCommand()"]
  c38ea253_eaec_a82d_bbe8_28e45a28dbf6 -->|calls| e280875d_a772_f261_3d24_55f4118e3e6d
  style e280875d_a772_f261_3d24_55f4118e3e6d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/snap/src/compiler.ts lines 197–205

async function format(
  inputCode: string,
  language: 'typescript' | 'flow',
): Promise<string> {
  return await prettier.format(inputCode, {
    semi: true,
    parser: language === 'typescript' ? 'babel-ts' : 'flow',
  });
}

Domain

Subdomains

Frequently Asked Questions

What does format() do?
format() is a function in the react codebase, defined in compiler/packages/snap/src/compiler.ts.
Where is format() defined?
format() is defined in compiler/packages/snap/src/compiler.ts at line 197.
What calls format()?
format() is called by 2 function(s): runCompileCommand, transformFixtureInput.

Analyze Your Own Codebase

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

Try Supermodel Free