You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CODE_STYLE.md
+14-16Lines changed: 14 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,31 +15,29 @@ This document outlines the code style guidelines for the Comty project. The goal
15
15
16
16
## Language-specific Guidelines
17
17
### JavaScript
18
-
- Use ES6 syntax and features whenever possible.
19
18
19
+
#### Do's
20
+
- Use ES6 syntax and features whenever possible.
20
21
- Use double quotes for strings, including for JSX.
21
-
22
22
- Use const and let instead of var.
23
-
24
23
- Always use strict equality (=== and !==) for comparisons.
24
+
- Use a CSS preprocessor like LESS. (We recommend use LESS cause it's used in the project, we prefer to no include another dependency)
25
+
- Use the :hover, :focus, and :active pseudo-classes as needed.
26
+
- Use descriptive class and ID names that clearly indicate their purpose.
27
+
- Use a consistent naming convention for classes and IDs, and avoid using inline styles.
25
28
29
+
#### Dont's
30
+
- Don't include unnecesary logs over the console.
31
+
- Don't declare unnecesary variables.
26
32
- Avoid using eval() and with().
27
33
34
+
#### Format
35
+
- Use 2 tabs for indentation.
36
+
- Use kebab-case for ID names.
28
37
- Use camelCase for variable and function names.
29
-
30
38
- Use PascalCase for class and component names.
31
39
32
-
- Use four spaces for indentation.
33
-
34
-
- Use a CSS preprocessor like LESS to organize styles. (We recommend use LESS cause it's used in the project, we prefer to no include another dependency)
35
-
36
-
- Use kebab-case for ID names.
37
-
38
-
- Use a consistent naming convention for classes and IDs, and avoid using inline styles.
39
-
40
-
- Use the :hover, :focus, and :active pseudo-classes as needed.
41
-
42
-
- Use descriptive class and ID names that clearly indicate their purpose.
40
+
Preferably use prettier to format all the code, the configuration file is included in the repository.
43
41
44
42
## Conclusion
45
-
By following these code style guidelines, we can create code that is easy to read, understand, and maintain. These guidelines are not exhaustive, and there may be cases where they don't apply or conflict with other guidelines. In such cases, use your best judgement and work with the team to come to a consensus.
43
+
By following these code style guidelines, we can create code that is easy to read, understand, and maintain. These guidelines are not exhaustive, and there may be cases where they don't apply or conflict with other guidelines. In such cases, use your best judgement and work with the team to come to a consensus.
0 commit comments