> ## 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.

# Inline Diagnostic Suppressions for GLua

> Suppress individual GLua diagnostics with inline comments when a specific finding is wrong but the rule should stay on for the rest of the project.

Sometimes a diagnostic fires on a line that is actually correct. Instead of weakening the rule globally, you can suppress that single finding with an inline comment. The rest of your codebase keeps the protection, and readers can see exactly why the exception exists.

## Suppression comment syntax

GLua Language Server recognizes several suppression styles in Lua comments.

```lua theme={null}
-- Suppress all rules on the next line
-- glua-ignore
local x = 1

-- Suppress one rule on the next line
-- glua-ignore unusedLocal
local y = 2

-- Suppress inline on the same line
local z = 3 -- glua-ignore unusedLocal

-- Disable a rule across a range
-- glua-disable realmViolation
if SERVER then
    -- client-only code that triggers a realm violation
end
-- glua-enable realmViolation

-- Suppress an entire file
-- glua-disable-file
```

## When to use suppressions

<Tip>
  If an entire path (like `lua/vendor/**`) triggers the same diagnostic, prefer a config file override in `.glua.json` instead of scattering suppression comments.
</Tip>

<Note>
  Suppress the specific rule name when possible. Avoid `-- glua-ignore` without a rule name because it silences every diagnostic on that line and can hide real problems.
</Note>


## Related topics

- [GLua Diagnostic Rules Reference](/reference/rules.md)
- [Configure GLua Language Server](/configuration/overview.md)
- [Get Started with GLua Language Server](/quickstart.md)
- [GLua Language Server: GMod Lua IDE Support](/index.md)
