Releases: JohnnyMorganz/StyLua
Releases Β· JohnnyMorganz/StyLua
v2.5.2
Immutable
release. Only release title and notes can be modified.
There were no code changes in this release, it was just a fix to npm publishing, see https://github.com/JohnnyMorganz/StyLua/releases/tag/v2.5.0 for the main updates
[2.5.2] - 2026-05-16
Fixed
- Fixed npm publishing failing provenance validation due to normalization of repository URL
Full Changelog: v2.5.1...v2.5.2
v2.5.1
Immutable
release. Only release title and notes can be modified.
There were no code changes in this release, it was an attempt to fix npm publishing, see https://github.com/JohnnyMorganz/StyLua/releases/tag/v2.5.0 for the main updates
[2.5.1] - 2026-05-16
Fixed
- Fixed npm publishing by bumping Node.js from 22 to 24 in CI workflows to support npm trusted publishing
Full Changelog: v2.5.0...v2.5.1
v2.5.0
Immutable
release. Only release title and notes can be modified.
[2.5.0] - 2026-05-16
Added
- Luau: Added support for
constvariable assignments (const x = 1) andconst functiondeclarations (#1102)
Changed
- The npm package
@johnnymorganz/stylua-binnow ships pre-built binaries via platform-specific optional packages (@johnnymorganz/stylua-bin-linux-x64,-linux-arm64,-darwin-x64,-darwin-arm64,-win32-x64) instead of downloading the binary at install time. This makes the packages self-contained with no extra dependencies.
Fixed
- Fixed npm publishing by bumping Node.js from 16 to 22 in CI workflows to support npm trusted publishing
- Luau: Fixed union/intersection type definitions not being hung when the type alone fits within the column width but the full line (including
=) exceeds it (#1104) - Luau: Fixed stray leading newlines not being removed from
local functionandconst functiondeclarations that have attributes (e.g.@native) at the start of a block (#1109)
Full Changelog: v2.4.1...v2.5.0
v2.4.1
Immutable
release. Only release title and notes can be modified.
[2.4.1] - 2026-04-06
Fixed
- Luau: Fixed panic when formatting explicit type instantiation (
f<<T>>()) inside a nested function call argument (e.g. as a callback) (#1088) - Luau: Fixed parentheses being incorrectly removed from single-element type packs in explicit type instantiation, e.g.
f<<(number)>>(10)becomingf<<number>>(10)(#1089)
Full Changelog: v2.4.0...v2.4.1
v2.4.0
Immutable
release. Only release title and notes can be modified.
[2.4.0] - 2026-03-07
Added
- Added flag
--no-ignore-vcsto continue formatting files listed in a.gitignorefile, instead of skipping over them (#895) - Support
call_parentheses = Inputin editorconfig (#1057) - Luau: Support formatting explicit type instantiations (
f<<T>>(),obj:method<<T>>()) - Support
stylua_syntaxandstylua_block_newline_gapsproperties in editorconfig (#1054)
Fixed
- Fixed syntax error in output when a single-line comment appears between an index suffix and a table call argument, e.g.
foo.bar -- comment { }(#873) - Fixed malformed formatting when a binary expression inside of a function call with comments around the operators is incorrectly collapsed onto one line (#996)
- Fixed repeated unary minus on long lines being collapsed into a comment, e.g.
- - - - -5becoming-----5(#1075) - Fixed
--preserve-block-newline-gapsCLI flag not being applied as a config override - Fixed LSP not respecting
.stylua.tomlon Windows due to incorrect file URI to path conversion (#1051)
External Contributions
- Remove WASM build workaround by @magic-akari in #1060
- Fix
call_parentheses = Inputdon't work in editorconfig by @phanen in #1057 - Fix path conversion on Windows by @8LWXpg in #1068
New Contributors
Full Changelog: v2.3.1...v2.4.0
v2.3.1
Immutable
release. Only release title and notes can be modified.
[2.3.1] - 2025-11-01
Fixed
- Use character-wised diff instead of byte-wise diff in the LSP server so that it can handle multi-byte characters (#1042, #1043).
External Contributions
New Contributors
Full Changelog: v2.3.0...v2.3.1
v2.3.0
[2.3.0] - 2025-09-27
Added
- The language server has an initialization option called
respect_editor_formatting_options.
If it's true, the formatting handler will override the configurationsindent-widthandindent-typewith values from FormattingOptions
Changed
- In language server mode, compute the difference between the unformatted and formatted document and only respond with the changes, rather than sending an edit for the whole file
- Include
serverInfoin the language server'sInitializeResponse
Fixed
- Fixed comments lost from expression after parentheses are removed when we are attempting to "hang" the expression. (#1033)
- Fixed
document_range_formatting_providercapability missing fromServerCapabilitiesin language server mode - Fixed current working directory incorrectly used as config search root in language server mode -- now, the root of the opened workspace is used instead (#1032)
- Language server mode now correctly respects
.styluaignorefiles (#1035) - Luau: Fixed parentheses incorrectly removed on a single type that is the default for a variadic generic parameter (#1038)
External Contributions
- Smaller text edits in lsp formatting handler by @TungstnBallon in #1031
New Contributors
- @TungstnBallon made their first contribution in #1031
Full Changelog: v2.2.0...v2.3.0
v2.2.0
[2.2.0] - 2025-09-14
Added
- Added option
block_newline_gapsto determine whether newline gaps at the start / end of blocks should be preserved. Defaults toNever, which is the original behaviour. (#857) - StyLua can now run in a language server mode. Start StyLua with
stylua --lspand connect with a language client. (#936)
Changed
- Luau: Improved union of tables formatting to hang the union type rather than attempt to hug all the tables together (#958)
Fixed
- Fixed formatting of index containing brackets string in parentheses (#992)
- Fixed goto not being recognised for LuaJIT (#986)
- Fixed semicolon removed after a statement ending with an if-expression leading to ambiguous syntax when the next line begins with parentheses (#1010)
- Luau: Fixed malformed formatting when there is a comment after a type specifier in a local assignment (#995)
- Luau: Fixed long type union formatted onto a single line if there is a comment in between the equals sign and the type union in a type declaration (#1007)
- Fixed StyLua installation via pip / uv for Windows (#1018)
External Contributions
- Fix formatting of index containing brackets string in parentheses by @phanen in #992
- Fix goto not being recognised for LuaJIT by @Sainan in #998
- Add option to preserve newline gaps for blocks by @InoUno in #857
- feat: Stylua LSP server by @PolyMeilex in #970
- fix(release-gitter): correct Windows asset name for pip build by @izzalDev in #1018
New Contributors
- @Sainan made their first contribution in #998
- @InoUno made their first contribution in #857
- @PolyMeilex made their first contribution in #970
- @izzalDev made their first contribution in #1018
Full Changelog: v2.1.0...v2.2.0
v2.1.0
[2.1.0] - 2025-04-21
Added
- Luau: Added support for parsing user-defined type functions (#938)
- Luau: Added support for parsing attributes (
@native/@deprecated) on functions - Added support for CfxLua (FiveM) syntax formatting. This is available with
syntax = "cfxlua"(#855) - Added a pre-built binary release for
stylua-linux-aarch64-musl.zip - Added error hints on parse failurse when a potential Lua syntax conflict is noticed (e.g., Lua 5.2 vs Luau syntax for labels
::and generics>>) (#960 / #962)
Changed
- Updated StyLua release GitHub action to
ubuntu-22.04workers due to GitHub's deprecation ofubuntu-20.04. This may mean the pre-built release artifacts published to GitHub no longer work onubuntu-20.04and require a manual build.
Fixed
- Luau: fixed parentheses incorrectly removed in
(expr :: assertion) < foowhen multilining the expression, leading to a syntax error (#940) - Fixed panic when attempting to format a file outside of the current working directory when
--respect-ignoresis enabled (#969) - Fixed unnecessary semicolons being introduced at the end of statements when incorrectly determined as ambiguous (#963)
- Fixed malformed formatting of function calls where parentheses are removed but there are comments in between the parentheses and the expression. Now, we will keep the parentheses in these cases, except for trailing comments (#964)
- Fixed malformed formatting of table field expression when there are comments in between the equals and the value (#942)
External Contributions
- Bump fullmoon to 1.2.0 by @Ukendio in #945
- fix: use "summary" for the missing
--checkerror message by @eitamal in #949 - Document --stdin-filepath in README.md by @notpeter in #954
- Fix panic when
--respect-ignores --stdin-filepathon external path to cwd by @phanen in #969 - Support Cfx Lua Syntax by @Kuuzoo in #972
New Contributors
- @Ukendio made their first contribution in #945
- @eitamal made their first contribution in #949
- @notpeter made their first contribution in #954
- @phanen made their first contribution in #969
- @Kuuzoo made their first contribution in #972
Full Changelog: v2.0.2...v2.1.0