This document identifies stale feature flags and provides guidance for their removal.
- Status: Stale (always on)
- Impact: Low
- Action: Remove flag and keep analytics enabled
- Status: Stale (all features are now stable)
- Impact: Low
- Action: Remove flag and enable all features
- Status: Never implemented
- Impact: None
- Action: Remove completely
- Status: Check usage
- Impact: Medium
- Action: Keep if used, remove if not
- Status: Implemented and stable
- Impact: Low
- Action: Remove flag and keep v2
- Status: Implemented and stable
- Impact: Low
- Action: Remove flag and keep v2
- Status: Active
- Reason: Used for feature toggling
- Status: Active
- Reason: Used for feature toggling
- Status: Active
- Reason: Used for feature toggling
- Status: Active
- Reason: Used for feature toggling
./scripts/audit-feature-flags.sh
./scripts/remove-feature-flag.sh <flag-name>
# Check flag usage
grep -r "flag_name" src/
# Verify removal
grep -r "flag_name" src/ | wc -l
# Should be 0
// src/config/feature-flags.ts
export const FEATURE_FLAGS = {
NEW_FEATURE: 'new_feature',
} as const;
// src/components/MyComponent.tsx
import { useFeatureFlag } from '../hooks/useFeatureFlag';
function MyComponent() {
const isEnabled = useFeatureFlag('new_feature');
return (
<div>
{isEnabled && <NewFeature />}
{!isEnabled && <LegacyFeature />}
</div>
);
}
// __tests__/components/MyComponent.test.tsx
import { render, screen } from '@testing-library/react';
import { FeatureFlagProvider } from '../src/providers/FeatureFlagProvider';
describe('MyComponent', () => {
it('should show new feature when enabled', () => {
render(
<FeatureFlagProvider flags={{ new_feature: true }}>
<MyComponent />
</FeatureFlagProvider>
);
expect(screen.getByText('New Feature')).toBeInTheDocument();
});
});
./scripts/audit-feature-flags.sh
./scripts/remove-feature-flag.sh <flag-name>