Expand description
Feature flag detection via lightweight Oxc AST visitor.
Detects three patterns:
- Environment variables:
process.env.FEATURE_X - SDK calls:
useFlag('name'),variation('name', false), etc. - Config objects:
config.features.x(opt-in, heuristic)
Always extracted during parse (lightweight pattern matching on MemberExpression
and CallExpression nodes). Custom SDK patterns and config object heuristics
are applied as a supplementary pass in the CLI when user config is present.
Functionsยง
- extract_
flags - Entry point: extract feature flag use sites from a parsed program.
- extract_
flags_ from_ source - Extract feature flags from source text with custom configuration.