mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 18:25:49 +03:00
Add code style rule for multiple return types
This commit is contained in:
parent
02fd35dad0
commit
3a159beb21
1 changed files with 4 additions and 0 deletions
|
@ -224,6 +224,10 @@ Unless otherwise specified, the following applies to all code:
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
37. Avoid functions whose behaviour / return type varies with different parameter types.
|
||||||
|
Multiple return types are fine when appropriate (eg. SDKConfig.get() with a string param which
|
||||||
|
returns the type according to the param given) but SDKConfig.get() with no args returning the
|
||||||
|
whole config object is not: this could just be a separate function.
|
||||||
|
|
||||||
## React
|
## React
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue