Skip to content

chore(Typecheck): Fail CI on new frontend type errors - #8826

Draft
talissoncosta wants to merge 6 commits into
chore/lint-review-rulesfrom
chore/typecheck-base
Draft

talissoncosta wants to merge 6 commits into
chore/lint-review-rulesfrom
chore/typecheck-base

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #8832

Stacked on #8819.

The frontend isn't type checked in CI, and main has about 760 type errors. This adds a CI step using tsc-baseline:

  • .tsc-baseline.json records today's errors (stories, documentation/ and .storybook/ excluded).
  • CI fails on a type error that isn't in the baseline, if it's in web/components/base/ or in a file the PR changed. New errors elsewhere are printed but don't fail.
  • After fixing errors, npm run typecheck:baseline shrinks the baseline. Later fix PRs add their folder to the list in the CI step.

Errors are matched by file and message, not line number, so moving code doesn't count as a new error. If tsc exits without reporting any errors (a crash), the step fails rather than passing on empty input.

Before merging: rerun npm run typecheck:baseline on the rebased branch, so errors that landed on main in the meantime are in the baseline.

To bring base/ to zero:

  • fixed the type errors in FocusMonitor and ParameterizedRoute
  • useOutsideClick and useOverflowVisibleCount accept React 19 nullable refs. Type only, wider than before, so no caller changes: DropdownMenu, ButtonDropdown, InlineModal, UserAction, SegmentOverrideActions, FeatureAction, SegmentAction, AccountDropdown, OverflowNav, Tabs

How did you test this code?

Ran the CI step locally against a fresh npm ci:

  • unchanged code passes
  • shifting lines in a file with existing errors passes
  • a new error in base/Banner fails
  • a new error in a file outside base/ that the PR didn't change is reported but passes
  • the baseline has no absolute paths
  • a tsc run that crashes without output fails the step

@github-actions github-actions Bot added front-end Issue related to the React Front End Dashboard chore labels Oct 21, 2026
@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.88%. Comparing base (742715d) to head (1120c1b).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           chore/lint-review-rules    #8826   +/-   ##
========================================================
  Coverage                    98.88%   98.88%           
========================================================
  Files                         1683     1683           
  Lines                        70275    70275           
========================================================
  Hits                         69489    69489           
  Misses                         786      786           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
docs Ignored Ignored Preview Oct 22, 2026 8:26am UTC
flagsmith-frontend-preview Ignored Ignored Preview Oct 22, 2026 8:26am UTC
flagsmith-frontend-staging Ignored Ignored Preview Oct 22, 2026 8:26am UTC

Request Review

@github-actions github-actions Bot added chore and removed chore labels Oct 21, 2026
@github-actions github-actions Bot removed the chore label Oct 21, 2026
@github-actions github-actions Bot added the chore label Oct 21, 2026
@talissoncosta talissoncosta changed the title chore(Typecheck): Type check base and changed lines in CI chore(Typecheck): Fail CI on new frontend type errors Oct 21, 2026
@github-actions github-actions Bot added chore and removed chore labels Oct 21, 2026
@github-actions github-actions Bot added chore and removed chore labels Oct 21, 2026
@github-actions github-actions Bot added chore and removed chore labels Oct 21, 2026
@github-actions github-actions Bot removed the chore label Oct 22, 2026
@github-actions github-actions Bot added the chore label Oct 22, 2026
talissoncosta and others added 6 commits October 22, 2026 09:26
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… tsc-baseline

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added chore and removed chore labels Oct 22, 2026

This branch was successfully deployed

2 active (outdated) deployments
Preview – flagsmith-frontend-preview — 9be949c3 Deployed Oct 21, 2026 by vercel[bot]
Preview – flagsmith-frontend-staging — 9be949c3 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant