StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

An opinionated Lua code formatter

Results 136 StyLua issues
Sort by recently updated
recently updated
newest added

Hello! I'm trying to use the [npm package](https://www.npmjs.com/package/@johnnymorganz/stylua) via [vite-plugin-wasm](https://github.com/Menci/vite-plugin-wasm), but I'm running into the following error: ``` Uncaught ReferenceError: Cannot access 'memory' before initialization at stylua_lib_bg.js?v=4e2ee103:671:42 (anonymous) @ stylua_lib_bg.js?v=4e2ee103:671...

enhancement

I have a file in my project that consistently causes Stylua to throw an error with the following message: `thread '' has overflowed its stack` This is a massive issue...

Hey ✌️ nice formatter tool 👍 I just try to globally raise my line length in neovim. I use the plugin conform for formatting and I wondered if I can...

```luau local function foo() return { b = "foo" } end local a = foo(); (a :: any).b ..= "bar" ``` Trying to use a `-- stylua: ignore` comment here...

I don't really know how to explain this but I do have a reproduction. ```luau -- Given this type: type Function = any do type ThisIsOkay = Function type ThisIsInvalidAndWhatResultsFromFormatting...

Currently, stylua wrongly indents comments right above an else clause, like this: ```lua -- Check for condition if condition then print("Condition satisfied") -- Otherwise else print("Condition not satisfied") end ```...

Expected Stylua to format the following as such: ```luau local thisWorksOnlyWith: { { longNamesAnd: any, itShouldNotPutThe: any, curlyBracketsOnAnotherLine: any, } } = {} ``` Actually formats as below with curly...

enhancement
luau

MWE `example.lua`: ```lua return -- insert whatever here 1 ``` ``` % stylua example.lua -- insert whatever here % cat example.lua return -- insert whatever here 1 ``` Which could...

We never developed proper formatting rules for string interpolation, just enough to get it working. We should revisit this.

enhancement

``` local f: & number & string = "hi" ``` This is valid Luau code: ![image](https://github.com/user-attachments/assets/72a01115-da1a-4937-b977-9e240801a8cf) StyLua cannot format it, though: ``` sarah@localhost ~/project (main) [2]> StyLua example.luau error: could...