Codemods for cleaning up OpenFeature usage in application code.
codemods/cleanup/openfeature-remove-stale-flag— remove a stale flag evaluation and simplify leftover control flow.
The first workflow step targets the OpenFeature Node.js server SDK (@openfeature/server-sdk). Additional workflow steps can be added later for other OpenFeature SDKs (web, React hooks, etc.) without renaming the package.
pnpm install
pnpm --filter ./codemods/cleanup/openfeature-remove-stale-flag test
pnpm --filter ./codemods/cleanup/openfeature-remove-stale-flag run check-typesRun the workflow against a sample tree (pass flagKey and value):
npx codemod workflow run \
-w codemods/cleanup/openfeature-remove-stale-flag/workflow.yaml \
--param flagKey=v2_enabled \
--param value=true