Adjusted project to match convention

This commit is contained in:
2023-12-07 10:36:13 +01:00
parent 660c250ad8
commit 2a60cecf2a
16 changed files with 59 additions and 85 deletions

View File

@@ -58,6 +58,7 @@ For this document's needs components and views will be named "modules" even thou
### Scripts
#### Elements should be placed in this order:
- Imports
- Props - constant defined by defineProps function, named "props" in code
This name allows to have readable code sending data to parent module:
```TS
@@ -67,7 +68,11 @@ This name allows to have readable code sending data to parent module:
```TS
emit("update:modelValue", exampleVariable)
```
- Interfaces
- Refs - constants defined by ref functions with appropriate values
- Injects - variables assigned by "inject" function
- Other variables/constants
- onFunctions - functions like onBeforeUpdate
- Other functions
#### Rules regarding functions:
@@ -75,7 +80,7 @@ This name allows to have readable code sending data to parent module:
- Ought to do one thing. ie. function sendRequest should send request, but not prepare request body or process response data
- In practice, if function has more than 10 SLoC, it probably should be split
- DO NOT use "any" type. Just don't.
- Function used in other function should be placed below it (if posible, as function can be called from many places in the code)
- Function used in other function should be placed below it (if possible, as function can be called from many places in the code)
#### Rules regarding variables and refs:
- Variables ought to have descriptive name