Closed mikavilpas closed 4 months ago
Sounds like you are experiencing the same problem as https://github.com/JohnnyMorganz/StyLua/issues/407
Unfortunately the stylua release binaries are built with all feature flags enabled, and the Luau type assertion syntax conflicts with Lua 5.2 label syntax.
You can use cargo to build a binary with only lua54 enabled and that should hopefully work
Thank you for the response! My issue is resolved.
Hi! I'm working on a project and trying to add support for checking lua formatting using stylua here https://github.com/sxyazi/yazi/pull/1029
Here are some findings:
using stylua 0.20.0
I am on osx (arm architecture) and installed stylua using
cargo install stylua --features lua54
. The files in the project can be formatted locally ($ which stylua reports the binary to be in/Users/mikavilpas/.cargo/bin/stylua
)if I download version 0.20.0 here, that version reports this issue:
I tried a couple of other versions from the last two years, but they all had a similar issue.
This is reproducible using this repository (StyLua itself). Example: