Loading...
LaunchDarkly flags multiply fast in TypeScript projects — especially when every React component gets its own feature gate. FlagShark scans your TypeScript AST to surface flags that have been fully rolled out or abandoned, then generates safe removal diffs.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
import { useFlags } from 'launchdarkly-react-client-sdk';
function PricingPage() {
const { newPricingTable } = useFlags();
if (newPricingTable) {
return <PricingTableV2 />;
}
return <PricingTableLegacy />;
}function PricingPage() {
return <PricingTableV2 />;
}FlagShark uses AST parsing with ts-morph for precise SDK call detection to find every call to variation(), variationDetail(), boolVariation(), stringVariation()across your React, Next.js, Node.js codebase.
Each detected flag key is matched against your LaunchDarkly project to check rollout status, last evaluation date, and whether the flag is archived or still active.
For each stale flag, FlagShark creates a pull request that removes the SDK call, eliminates the dead code branch, and preserves the winning path. Every PR includes a before/after diff you can review.
The LaunchDarkly React SDK exposes flags via a hook that destructures dynamic keys — if your team uses computed flag names like `flags[featureKey]`, static analysis cannot resolve them without runtime telemetry.
Grep misses flags behind abstractions. AST-level scanning catches SDK calls that regex can't.
Every cleanup goes through code review. No surprises, no broken builds.
Only flags at 100% rollout for your configured threshold are suggested for removal.
New stale flags are detected automatically. Your codebase stays clean without manual audits.
variation()variationDetail()boolVariation()stringVariation()Plus custom patterns you define in .flagshark.yaml
FlagShark uses ts-morph to parse your TypeScript AST and traces every call to `useFlags()`, `ldClient.variation()`, and related SDK methods. It correlates those calls with your LaunchDarkly dashboard to determine which flags are fully rolled out or archived.
Yes. FlagShark generates removal diffs that preserve your application logic — the winning code path stays, and the dead branch is removed. You can preview every change before merging, and the tool accounts for server components, client components, and API routes.
Beyond simple boolean checks, FlagShark detects type narrowing guards that depend on flag values, conditional JSX rendering, and flags threaded through React context providers. It also identifies flag-related TypeScript types and interfaces that should be cleaned up.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
Step-by-step process for identifying and removing dead LaunchDarkly flags in Django, FastAPI, and Flask applications.
How to find, evaluate, and remove unused LaunchDarkly feature flags from Go microservices and CLI tools.
Practical guide to removing stale LaunchDarkly flags from Spring Boot and Micronaut applications.
Find and safely remove LaunchDarkly feature flags buried in Rails controllers, views, and background jobs.
Leverage Rust's type system and FlagShark's syn-based analysis to remove stale LaunchDarkly flags from Actix and Axum services.
Use Roslyn analyzers and FlagShark to find and remove stale LaunchDarkly flags in ASP.NET Core and .NET services.
Detect and remove abandoned Split.io treatments from your TypeScript frontend and Node.js backend.
Find and remove stale Unleash feature toggles from React, Next.js, and Node.js TypeScript projects.
Detect and remove abandoned PostHog feature flags from React and Next.js TypeScript applications.
Find and safely remove stale Flagsmith flags from React and Node.js TypeScript codebases.
Detect and remove stale ConfigCat feature flags from React and Node.js TypeScript projects.