-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Conventions
Decide whether to use 2 spaces and use them consistently.
Of course, Eslint will solve it.
Use concise names that convey meaning well. Instead of userCount, we prefer clear expressions such as numberOfUsers.
Use a combination of verbs and nouns to clearly express your intent.
Use it with getUserData or postUserData.
Use Camel Case and select a name that illustrates the class's role or responsibility.
Use Pascal Case, and for interfaces, put an I in front.
Add annotations to the logic where the purpose of the code is difficult to understand or important. Comments should be concise and clear, and they should serve to help you understand the code.
For annotation of a function, annotate the function in /** Here comes annotation */ above it to make it easier to see the annotation of the function in other files.
Group the relevant files in the appropriate directory and define file and directory naming rules. Minimize dependence between modules and define interfaces if necessary to promote modularity.
Specify the position of brackets (e.g., on the next line or on the current line) Increase the readability of the code by limiting the length of a line.
Be careful about version management when using external libraries or frameworks. Minimize external dependence and understand well through documents about the library you use.# Indent Rule Leave all spaces free of tabs
This is footer
This is side bar