Skip to main content

Module flags

Module flags 

Source
Expand description

Feature flag detection via lightweight Oxc AST visitor.

Detects three patterns:

  1. Environment variables: process.env.FEATURE_X
  2. SDK calls: useFlag('name'), variation('name', false), etc.
  3. 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.