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:
- Define configuration values in a centralized location
- Reference these values using constants or environment variables
- 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>
);
}