Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylua removes parentheses surrounding an if-else expression, breaking code. #345

Closed
rstk opened this issue Jan 25, 2022 · 0 comments · Fixed by #346
Closed

Stylua removes parentheses surrounding an if-else expression, breaking code. #345

rstk opened this issue Jan 25, 2022 · 0 comments · Fixed by #346
Labels
bug Something isn't working

Comments

@rstk
Copy link

rstk commented Jan 25, 2022

Say I write something like this:

local foo = (if true then 0 else 1) + 1
print(foo)

This will print 1.

However, when running stylua, it will remove the parentheses:

local foo = if true then 0 else 1 + 1
print(foo)

This will print 0.

Tested with stylua 0.11.3 installed via foreman, with the default config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants