> ## Documentation Index
> Fetch the complete documentation index at: https://glua.bluejutzu.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Committed Config Files for GLua

> Use .glua.json for linter rules and .gluafmtrc.json for formatter options so your whole team shares the same settings without extra setup.

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.

```json theme={null}
{
  "globals": ["ULib", "ulx"],
  "diagnostics": {
    "unusedLocal": "warning",
    "realmViolation": "error"
  },
  "overrides": {
    "lua/vendor/**": {
      "diagnostics": {
        "unusedLocal": "off"
      }
    }
  }
}
```

* `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.

```json theme={null}
{
  "useTabs": false,
  "indentSize": 4,
  "maxLineWidth": 120,
  "quoteStyle": "double",
  "keepSingleLineBlocks": true,
  "overrides": {
    "lua/config/**": {
      "indentSize": 2
    }
  }
}
```

* `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.

<Info>
  Both `.glua.json` and `.gluafmtrc.json` ship with bundled JSON schemas, so you get IntelliSense and validation while editing them in VS Code.
</Info>


## Related topics

- [Configure GLua Language Server](/configuration/overview.md)
- [GLua Code Formatter](/features/formatter.md)
- [GLua Language Server Commands](/reference/commands.md)
- [Get Started with GLua Language Server](/quickstart.md)
