github JohnnyMorganz/StyLua v0.18.0

latest releases: v0.20.0, v0.19.1, v0.19.0...
17 months ago

[0.18.0] - 2023-06-14

Added

  • Multiline ignores (-- stylua: ignore start / -- stylua: ignore end) will now work within table fields:
require("foo").bar {
	-- stylua: ignore start
	baz      =0, -- < not formatted
	foo   =   2, -- < not formatted
	-- stylua: ignore end
	bar        =     1234 -- < formatted
}
  • Added option "Input" to call_parentheses setting, where call parentheses are retained based on their presence in the original input code.
    Note: this setting removes all automation in determining call parentheses, and consistency is not enforced.

Changed

  • Improved heuristics around Luau type excess parentheses removal, so unnecessary parentheses around types are removed in more locations

Fixed

  • Function calls are now formatted onto multiple lines if the opening brace { of a multiline table forces one of the lines over width
  • Fixed missing option --sort-requires to enable sort requires on the command line
$ stylua --sort-requires test.lua
  • Fixed parentheses removed around Luau optional type (B?) causing syntax errors when present in an intersection A & (B?)
  • Fixed comments lost when parentheses removed around Luau types
  • Fixed race condition where if a file is passed more than once as an argument to format, then it could potentially be wiped completely (for example, if an ancestor directory is passed and recursively searched, as well as the file itself)

Don't miss a new StyLua release

NewReleases is sending notifications on new releases.