Skip to content

feat(format): add stylua formatter for Lua files#27728

Open
wangyang377 wants to merge 2 commits into
anomalyco:devfrom
wangyang377:feat/add-stylua-formatter
Open

feat(format): add stylua formatter for Lua files#27728
wangyang377 wants to merge 2 commits into
anomalyco:devfrom
wangyang377:feat/add-stylua-formatter

Conversation

@wangyang377
Copy link
Copy Markdown

Add built-in StyLua formatter support for .lua files. StyLua is detected via PATH lookup and runs stylua $FILE.

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Add built-in StyLua formatter for .lua files, following the same pattern as gofmt, shfmt, and dfmt.

StyLua is an opinionated Lua code formatter written in Rust (inspired by Prettier), and is the de facto standard formatter in the Lua ecosystem (Neovim configs, Roblox/Luau development, Love2D, etc.).

The implementation:

  • Detects stylua via PATH lookup using which("stylua")
  • Runs stylua $FILE on .lua files
  • Added the stylua entry to the formatter docs table across all 18 locales

How did you verify your code works?

  • Confirmed stylua appears in Format.Service.status() when formatters are enabled
  • Verified .lua files are formatted correctly with stylua installed locally
  • Checked that the existing format.test.ts test suite still passes

Screenshots / recordings

N/A — no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

wangyang690 and others added 2 commits May 15, 2026 19:12
Add built-in StyLua formatter support for .lua files.
StyLua is detected via PATH lookup and runs `stylua $FILE`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant