Back to all reviewers

prefer established configuration patterns

mastodon/mastodon
Based on 2 comments
TSX

When making configuration choices, prioritize existing centralized configuration values and established patterns over ad-hoc solutions or deprecated frameworks. This reduces technical debt and maintains consistency across the codebase.

Configurations TSX

Reviewer Prompt

When making configuration choices, prioritize existing centralized configuration values and established patterns over ad-hoc solutions or deprecated frameworks. This reduces technical debt and maintains consistency across the codebase.

Use centralized configuration exports instead of direct API calls:

// Avoid direct browser API calls
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');

// Prefer existing centralized configuration
import { reduceMotion } from 'mastodon/initial_state';

Similarly, avoid deprecated frameworks when the team is actively migrating away from them:

// Avoid if migrating away from rails-ujs
Rails.delegate(/* ... */);

// Consider alternative approaches that align with migration plans

Before introducing new configuration approaches, check if equivalent centralized values or patterns already exist in the codebase. This ensures consistency and reduces maintenance overhead during framework migrations or refactoring efforts.

2
Comments Analyzed
TSX
Primary Language
Configurations
Category

Source Discussions