Skip to content

Releases: JohnnyMorganz/StyLua

v2.5.2

16 May 15:52
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

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

16 May 15:46
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

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

16 May 15:16
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

[2.5.0] - 2026-05-16

Added

  • Luau: Added support for const variable assignments (const x = 1) and const function declarations (#1102)

Changed

  • The npm package @johnnymorganz/stylua-bin now 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 function and const function declarations that have attributes (e.g. @native) at the start of a block (#1109)

Full Changelog: v2.4.1...v2.5.0

v2.4.1

06 Apr 14:51
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

[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) becoming f<<number>>(10) (#1089)

Full Changelog: v2.4.0...v2.4.1

v2.4.0

07 Mar 13:47
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

[2.4.0] - 2026-03-07

Added

  • Added flag --no-ignore-vcs to continue formatting files listed in a .gitignore file, instead of skipping over them (#895)
  • Support call_parentheses = Input in editorconfig (#1057)
  • Luau: Support formatting explicit type instantiations (f<<T>>(), obj:method<<T>>())
  • Support stylua_syntax and stylua_block_newline_gaps properties 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. - - - - -5 becoming -----5 (#1075)
  • Fixed --preserve-block-newline-gaps CLI flag not being applied as a config override
  • Fixed LSP not respecting .stylua.toml on Windows due to incorrect file URI to path conversion (#1051)

External Contributions

New Contributors

Full Changelog: v2.3.1...v2.4.0

v2.3.1

01 Nov 14:00
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

[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

  • fix: Handle Unicode characters in LSP formatting by @Davidyz in #1044

New Contributors

Full Changelog: v2.3.0...v2.3.1

v2.3.0

27 Sep 11:02

Choose a tag to compare

[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 configurations indent-width and indent-type with 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 serverInfo in the language server's InitializeResponse

Fixed

  • Fixed comments lost from expression after parentheses are removed when we are attempting to "hang" the expression. (#1033)
  • Fixed document_range_formatting_provider capability missing from ServerCapabilities in 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 .styluaignore files (#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

14 Sep 19:46

Choose a tag to compare

[2.2.0] - 2025-09-14

Added

  • Added option block_newline_gaps to determine whether newline gaps at the start / end of blocks should be preserved. Defaults to Never, which is the original behaviour. (#857)
  • StyLua can now run in a language server mode. Start StyLua with stylua --lsp and 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

Full Changelog: v2.1.0...v2.2.0

v2.1.0

21 Apr 18:00

Choose a tag to compare

[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.04 workers due to GitHub's deprecation of ubuntu-20.04. This may mean the pre-built release artifacts published to GitHub no longer work on ubuntu-20.04 and require a manual build.

Fixed

  • Luau: fixed parentheses incorrectly removed in (expr :: assertion) < foo when 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-ignores is 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 --check error message by @eitamal in #949
  • Document --stdin-filepath in README.md by @notpeter in #954
  • Fix panic when --respect-ignores --stdin-filepath on external path to cwd by @phanen in #969
  • Support Cfx Lua Syntax by @Kuuzoo in #972

New Contributors

Full Changelog: v2.0.2...v2.1.0

v2.0.2

07 Dec 15:07

Choose a tag to compare

[2.0.2] - 2024-12-07

Fixed

  • Fixed regression where configuration present in current working directory not used when formatting from stdin and no --stdin-filepath is provided (#928)
  • Luau: fixed incorrect indentation for leading token in union / intersection when hanging (#932)