Loading...
Flagsmith blends feature flags and remote config in a single API. That flexibility means your TypeScript codebase can have both boolean flags and string/JSON config values scattered across components. FlagShark identifies which ones are ready to be inlined or removed.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
import flagsmith from 'flagsmith';
function ChatWidget() {
const hasChat = flagsmith.hasFeature('live-chat');
const chatTheme = flagsmith.getValue('live-chat');
if (hasChat) {
return <LiveChat theme={chatTheme as string} />;
}
return <ContactForm />;
}function ChatWidget() {
return <LiveChat theme="modern" />;
}FlagShark uses AST parsing with ts-morph for precise SDK call detection to find every call to has_feature(), get_value(), get_trait()across your React, Next.js, Node.js codebase.
Each detected flag key is matched against your Flagsmith 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.
Flagsmith's `getValue()` returns remote config values that may change independently of the flag's enabled state — removing the feature flag without inlining the correct config value can hardcode the wrong default.
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.
has_feature()get_value()get_trait()Plus custom patterns you define in .flagshark.yaml
FlagShark traces the `flagsmith` import and detects calls to `hasFeature()`, `getValue()`, and `getTrait()`. It reads your Flagsmith environment to determine the current flag state and remote config values.
Yes. When a Flagsmith feature has an associated remote config value, FlagShark inlines the current value from your environment rather than just removing the check. This preserves runtime behavior.
FlagShark detects `flagsmith.identify()` calls and per-identity flag overrides. It warns when a flag has identity-specific overrides that differ from the default, so you can review before cleanup.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
A hands-on guide to finding and safely removing stale LaunchDarkly feature flags from TypeScript and React codebases.
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.
Detect and remove stale ConfigCat feature flags from React and Node.js TypeScript projects.