Skip to content

TypeScript errors in charts/analyze directory (splitNumber, decal, implicit any types) #2910

@sykp241095

Description

@sykp241095

Description

Multiple TypeScript type errors exist in the apps/web/charts/analyze directory. These errors prevent clean builds and indicate potential runtime issues with ECharts configurations.

Affected Files

  1. apps/web/charts/analyze/org/activity-open-to-close/visualization.ts
  2. apps/web/charts/analyze/org/activity-open-to-first-response/visualization.ts
  3. apps/web/charts/analyze/org/engagement-scatter/visualization.ts
  4. apps/web/charts/analyze/org/pull-requests-open-to-review/visualization.ts
  5. apps/web/charts/analyze/org/recent-pr-review-stats/visualization.ts
  6. apps/web/charts/analyze/org/recent-stats/visualization.ts

Errors

1. splitNumber property does not exist on YAxisOption

  • Files: activity-open-to-close, activity-open-to-first-response, pull-requests-open-to-review
  • Error: Object literal may only specify known properties, and 'splitNumber' does not exist in type...
  • Location: Y-axis configuration (lines 105-106)
  • Fix: Remove splitNumber property or update ECharts type definitions

2. Implicit any type for formatter parameters

  • Files: activity-open-to-close, engagement-scatter, pull-requests-open-to-review
  • Error: Parameter 'params' implicitly has an 'any' type
  • Location: Tooltip/formatter functions (lines 156, 179)
  • Fix: Add explicit type annotation: params: TooltipFormatterParams

3. data property does not exist on TopLevelFormatterParams

  • File: engagement-scatter/visualization.ts
  • Error: Property 'data' does not exist on type 'TopLevelFormatterParams'
  • Location: Line 144
  • Fix: Use correct property access or type guard

4. decal type mismatch in AriaOption

  • Files: recent-pr-review-stats, recent-stats
  • Error: Type 'false | { enabled: true; decal: { show: true; }; }' is not assignable to type 'AriaOption | undefined'
  • Location: Lines 73, 158
  • Fix: Update aria configuration to match ECharts AriaOption type

Impact

  • TypeScript builds fail with errors
  • Potential runtime issues if ECharts receives invalid configuration
  • Developer experience degraded by type errors

Suggested Fix

  1. Review ECharts type definitions and update configurations accordingly
  2. Add explicit type annotations for formatter parameters
  3. Validate aria/decal configurations against current ECharts API

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions