Home / Function/ testRule() — react Function Reference

testRule() — react Function Reference

Architecture documentation for the testRule() function in shared-utils.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  7cb0395e_ec02_facf_a171_f9c7ce1a86b7["testRule()"]
  799656f0_feaf_2c82_77fc_4a08283ea146["shared-utils.ts"]
  7cb0395e_ec02_facf_a171_f9c7ce1a86b7 -->|defined in| 799656f0_feaf_2c82_77fc_4a08283ea146
  style 7cb0395e_ec02_facf_a171_f9c7ce1a86b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/eslint-plugin-react-compiler/__tests__/shared-utils.ts lines 28–47

export function testRule(
  name: string,
  rule: Rule.RuleModule,
  tests: {
    valid: ESLintTester.ValidTestCase[];
    invalid: ESLintTester.InvalidTestCase[];
  },
): void {
  const eslintTester = new ESLintTester({
    // @ts-ignore[2353] - outdated types
    parser: require.resolve('hermes-eslint'),
    parserOptions: {
      ecmaVersion: 2015,
      sourceType: 'module',
      enableExperimentalComponentSyntax: true,
    },
  });

  eslintTester.run(name, rule, tests);
}

Domain

Subdomains

Frequently Asked Questions

What does testRule() do?
testRule() is a function in the react codebase, defined in compiler/packages/eslint-plugin-react-compiler/__tests__/shared-utils.ts.
Where is testRule() defined?
testRule() is defined in compiler/packages/eslint-plugin-react-compiler/__tests__/shared-utils.ts at line 28.

Analyze Your Own Codebase

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

Try Supermodel Free