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), flag({ key: 'name' }), 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ยง

builtin_env_prefixes
Built-in environment variable prefixes treated as feature flags.
builtin_sdk_providers
Distinct built-in SDK provider labels, in declaration order.
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.