Skip to content

Latest commit

 

History

History
76 lines (49 loc) · 2.51 KB

File metadata and controls

76 lines (49 loc) · 2.51 KB

FAQ

What does stylua_wrapper do?

It is a thin launcher around the real stylua binary from your PATH.

On each run it:

  1. Checks the current working directory for stylua.toml or .stylua.toml.
  2. If neither exists, copies stylua.default.toml (next to this executable) into ./stylua.toml.
  3. Forwards all CLI arguments to stylua and returns the same exit code.

Why not call StyLua directly?

Editors and format-on-save tools often invoke StyLua without ensuring a project config exists. This wrapper seeds a known-good default once, then behaves like StyLua.

How do I install it?

  1. Install StyLua so stylua is on your PATH.
  2. Download the release zip for your OS and extract it somewhere stable.
  3. Keep the wrapper binary and stylua.default.toml in the same folder.
  4. Point your editor / formatter setting at the wrapper instead of stylua.

Example VS Code / Cursor (settings.json):

{
  "stylua.styluaPath": "/path/to/stylua_wrapper"
}

On Windows use the .exe path, for example C:\\Tools\\stylua_wrapper\\stylua_wrapper.exe.

Which release zip should I download?

Platform Download
Windows x64 stylua_wrapper-windows-x64.zip
Linux x64 stylua_wrapper-linux-x64.zip
macOS Apple Silicon stylua_wrapper-macos-arm64.zip
macOS Intel stylua_wrapper-macos-x64.zip

How do I change the default config?

Edit stylua.default.toml next to the executable. New projects without a config will receive that template as stylua.toml.

Existing projects that already have stylua.toml / .stylua.toml are never overwritten.

How do I enable logging?

Either:

  • Set environment variable STYLUA_WRAPPER_LOG=1, or
  • Create an empty stylua_wrapper.log next to the executable.

Logs append to stylua_wrapper.log in the same directory as the executable.

StyLua is not found / FATAL error

The wrapper does not bundle StyLua. Install it and confirm:

# Linux / macOS
command -v stylua
stylua --version

# Windows
where stylua
stylua --version

Then retry formatting.

Will it modify my existing StyLua config?

No. If stylua.toml or .stylua.toml is already present in the working directory, the wrapper does nothing except forward arguments to StyLua.