Back to all reviewers

Use configuration over hardcoding

supabase/supabase
Based on 3 comments
TSX

Always use configuration constants instead of hardcoding values directly in the code. This improves maintainability and reduces errors when values need to change across different environments or contexts.

Configurations TSX

Reviewer Prompt

Always use configuration constants instead of hardcoding values directly in the code. This improves maintainability and reduces errors when values need to change across different environments or contexts.

Key practices:

  1. Define configuration values in a centralized location
  2. Reference these values using constants or environment variables
  3. Make text and numerical values dynamic when they represent configurable limits or settings

Example:

// โŒ Bad
const StorageSettings = () => {
  return (
    <div>
      Maximum size in bytes of a file that can be uploaded is 500 GB
    </div>
  );
}

// โœ… Good
const StorageSettings = () => {
  return (
    <div>
      Maximum size in bytes of a file that can be uploaded is {
        formatBytes(STORAGE_FILE_SIZE_LIMIT_MAX_BYTES_UNCAPPED)
      }
    </div>
  );
}
3
Comments Analyzed
TSX
Primary Language
Configurations
Category

Source Discussions