mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-03-04 08:12:31 -05:00
750 B
750 B
Coding Guidelines
- Anytime you don't use {} on an if statement, it must be on one line and MUST be a jump operation (return/continue/break). All other times, you must use {} and be on 2 lines.
- Use var whenever possible
- return statements should generally have a newline above them Examples:
# Case when okay - simple logic flow
var a = 2 + 3;
return a;
# Case when needs newline - complex logic is grouped together
var a = b + c;
_imageService.Resize(...);
return;
- Operation (+,-,*, etc) should always have spaces around it; I.e.
a + bnota+b. - Comma's
,should always be followed by a space - When setting href directectly (not using Angulars routing) it should always be prefixed with baseURL