flag-prune

Remove Statsig feature flags

Remove stale Statsig feature gates from JavaScript and TypeScript code with flag-prune. See the official Statsig JavaScript SDK documentation.

Replace checkGate

if (client.checkGate("enable-new-search")) {
  showNewSearch()
} else {
  showOldSearch()
}

Preview a gate that is permanently enabled:

npx flag-prune --set 'client.checkGate("enable-new-search")=true' src

Result:

showNewSearch()

After reviewing the diff:

npx flag-prune --set 'client.checkGate("enable-new-search")=true' --write src

The receiver is an exact part of the rule. If the client variable is named statsig, use statsig.checkGate("enable-new-search") instead.

Dynamic config and experiment APIs return structured results. Do not replace the whole object with a primitive; use a primitive gate or refactor first.

See all provider guides and the detailed call matching rules.