lint: reduce scope

Fix some lint warnings of kind
```
style (variableScope): The scope of the variable '…' can be reduced
```
I don't understand this. What was the intention of these brackets?