Always use named constants, enums, or well-defined configuration objects instead of magic strings, numbers, or inline literals for configuration values. This improves maintainability, reduces typos, enables better IDE support, and makes configuration changes easier to track.
Examples of good practices:
status === EngineStatus.ready
instead of status === 'ready'
const EXPERIMENTAL_FEATURE = 'experimentalFeature'
instead of inline stringslocalStorage.getItem(HTTPS_PROXY_FEATURE) ?? ""
serverEnabled: boolean
instead of serverEnabled?: boolean
This approach makes configuration management more robust and prevents runtime errors from typos in configuration keys or values.
Enter the URL of a public GitHub repository