Do not use underscore prefixes (`_`) for private or internal methods and properties. The team consensus is to avoid this naming convention. Instead, use one of these alternatives:
Do not use underscore prefixes (_
) for private or internal methods and properties. The team consensus is to avoid this naming convention. Instead, use one of these alternatives:
#
prefix for truly private class membersExamples:
❌ Avoid:
_isInLightMode() {
return this.interfaceColor.colorModeIsLight;
}
_getUserColorSchemeDifferences() {
// implementation
}
✅ Prefer:
// Option 1: Remove prefix
isInLightMode() {
return this.interfaceColor.colorModeIsLight;
}
// Option 2: Use proper private syntax
#getUserColorSchemeDifferences() {
// implementation
}
// Option 3: Convert to getter when appropriate
get userColorSchemeDifferences() {
// implementation
}
This convention improves code clarity and follows modern JavaScript standards while maintaining team consistency.
Enter the URL of a public GitHub repository