StyLua
StyLua copied to clipboard
`local var; var = ...` looks better in the same line (suggestion)
Sometimes we use a local variable inside an anonymous function like so:
local connection
connection = ...(function()
connection:Disconnect()
end)
And doing this makes it look better imo:
local connection; connection = ...(function()
connection:Disconnect()
end)
Is there a chance we could have this as a configuration flag?
This is an interesting suggestion.
For simplicity and consistency, I am somewhat hesitant about adding something like this in, but I will give it a think
A similar case is
local foo do
local bar = "bar"
foo = bar
end
which I wished stylua puts the do
in the same line of local foo
.
This is an interesting suggestion.
For simplicity and consistency, I am somewhat hesitant about adding something like this in, but I will give it a think
Hi, i'd like to bump this because ever since the suggestion I've been wishing this was an addition. Could this be added as a configuration option so it's not intrusive for those who don't want it?