Skip to main content
Committed config files let you store linter and formatter settings in version control. When a teammate opens the project, the language server reads these files automatically. No one has to manually import UI settings or keep personal configs in sync.

Creating config files

You can seed a config file from your current VS Code UI settings with one command. Open the Command Palette and run either of the following:
  • GLua: Create Linter Config File (creates .glua.json)
  • GLua: Create Formatter Config File (creates .gluafmtrc.json)
These commands write the file at the workspace root using whatever settings are active in your editor at that moment.

Linter config (.glua.json)

Use .glua.json to define globals, diagnostic severity, and per-path overrides.
  • globals: declare addon names or libraries that are available at runtime but not defined in your workspace.
  • diagnostics: set any rule to "off", "warning", or "error".
  • overrides: apply different rules to specific paths. In the example, vendored files under lua/vendor/** do not report unused locals.

Formatter config (.gluafmtrc.json)

Use .gluafmtrc.json to control indentation, line width, quotes, and block collapsing.
  • useTabs: indent with tabs instead of spaces.
  • indentSize: number of spaces per indent level (ignored when useTabs is true).
  • maxLineWidth: soft wrap target for long lines.
  • quoteStyle: "double" or "single" for string literals.
  • keepSingleLineBlocks: preserve one-line if blocks instead of forcing expansion.
  • overrides: change formatting per path. In the example, files under lua/config/** use two-space indentation.
Both .glua.json and .gluafmtrc.json ship with bundled JSON schemas, so you get IntelliSense and validation while editing them in VS Code.