Maintain consistent spacing patterns around operators, keywords, and interpolation syntax throughout the codebase. This improves readability and reduces cognitive load when scanning code.
Key guidelines:
new
to distinguish them from method calls: new (x: number) => void
#{$variable}
or #{ $variable }
but not mixed usageExample of good operator placement:
const result = someCondition
&& anotherLongCondition
|| fallbackCondition;
Example of consistent interpolation spacing:
// Consistent - no spaces
.icon-#{$size} { }
.text-#{$name} { }
// Consistent - with spaces
.icon-#{ $size } { }
.text-#{ $name } { }
This consistency helps establish clear visual patterns that make code easier to read and maintain, while reducing debates about formatting during code reviews.
Enter the URL of a public GitHub repository