Arista EOS Config Linter

Find the line the switch would refuse before you push it.
Running-configs, AVD output, configlets and change scripts are checked as you type against EOS's own command tree. An error means EOS refuses the line. A warning means EOS accepts it, but something is off. The same knowledge drives completion, quick fixes, navigation and a rename that never half-finishes. All offline.
Features
Standard VS Code gestures throughout: nothing new to learn.
Diagnostics you can trust. Each line is checked against its mode's syntax a quarter-second after you pause.
- Errors:
descripton (with "did you mean"), switchport mode trunkk, vlan 5000, ip address under vlan 10 ("it is valid in interface — is this line indented wrong?"), a banner with no EOF.
- Warnings: a line EOS accepts outside the block its indent suggests; a feature cEOS-lab lacks (
hardware tcam): maybe valid on hardware, its lines unchecked.
- Never errors: hidden or deprecated commands EOS still takes (
channel-protocol lacp).
Problems panel: Ctrl+Shift+M (Cmd+Shift+M on macOS); F8 steps through.
Follows the mode, not your indentation. Like EOS, a dedent or ! never leaves a mode, so flat snippets and change scripts lint as the switch reads them. Just paste.
Hover. A line's mode and matched syntax; on a cross-reference finding, its basis (the lab probe, if any). Mouse over, or Ctrl+K Ctrl+I (Cmd+K Cmd+I on macOS).
Cross-reference checks at the switch's severity. Undefined names (77 kinds), undeclared VLANs, duplicate addresses in a VRF and things defined twice, quoting EOS where it speaks:
- VRF BLUE is not defined in this document — EOS refuses this line (% VRF BLUE not configured.): error.
- VLAN 30 is not declared (no
vlan 30) — EOS accepts the line and creates no VLAN: warning.
Unused definitions, greyed out. A route-map, prefix-list, ACL or VLAN nothing uses fades. Off by default: a config need not use all it defines. Set "eos.lint.unused": true.
Quick fixes the switch accepted. On an undefined name or undeclared VLAN: Did you mean (RM_OUT → RM-OUT), Create the smallest definition EOS accepts, placed where EOS needs it (61 of 77 kinds), or Declare VLAN 30, each one undoable edit.
- Policy and access stay your call: a new
route-map X permit 10 permits everything and an empty ACL drops everything, so the 16 kinds that decide them (route-maps, ACLs, prefix-lists, AAA groups, …) open Refactor Preview unticked: tick the change, then Apply. Apply with nothing ticked applies nothing.
- Never created: credentials (usernames, SNMP users or communities) or a
router bgp: the AS is yours.
Ctrl+. (Cmd+. on macOS) or the lightbulb.
Completion that mirrors ?. The mode's next keyword (per interface type, too) and this document's names of the right kind. Abbreviations too: after sw mo and a space you get what switchport mode gets. Type a word and a space, or Ctrl+Space (on macOS too). For the switch's words alone (false on older VS Code):
"[eos]": { "editor.wordBasedSuggestions": "off" }
Go to Definition and Peek. From a name to the lines defining it, matched as EOS matches (et 12 is Ethernet12). F12 or Ctrl+click (Cmd+click on macOS); Ctrl+hover (Cmd+hover) previews. Peek: Alt+F12 (Option+F12 on macOS, Ctrl+Shift+F10 on Linux).
Find References and highlights. Every use of a name, even one this document never defines; with the cursor on a name, its definitions highlight as writes and its uses as reads. Shift+F12.
Rename. F2 renames a name wherever it's written, an interface in any spelling (et 12, Ethernet12), in one undoable edit: a VRF across interfaces, BGP and static routes. If that can't be complete or right, it refuses and says why: ranges or lists (split them first), built-ins, places it can't read, collisions EOS would merge, names EOS would refuse. F2, type, Enter.
Outline and breadcrumbs. One symbol per block, nested as the config nests: router bgp 65100 › vrf Tenant_A › address-family ipv4. Outline view, breadcrumbs bar, or Ctrl+Shift+O (Cmd+Shift+O on macOS).
Exact folding. Each block folds through its trailing !, so Fold All leaves one line per block. Ctrl+K Ctrl+0 (Cmd+K Cmd+0 on macOS); Ctrl+K Ctrl+J (Cmd+K Cmd+J) unfolds.
Highlighting and editing built for EOS. Your names, interfaces, addresses, secrets and blocks like banner and action bash (as shell) stand out; auto-indent after block openers; double-click grabs RM-CONN-2-BGP or 10.255.0.3/32 whole. Ctrl+/ (Cmd+/ on macOS) toggles ! comments.
Opens the right files as EOS. By name (running-config, startup-config, *.eos) or content (.cfg, .conf, .txt, untitled pastes); IOS, NX-OS and Junos configs never flip. A document switches at most once while open, so setting it back (Ctrl+K M / Cmd+K M) sticks; the EOS Linter output channel (View › Output) says why. An explicit association always wins:
"files.associations": { "**/intended/configs/*.cfg": "eos" }
Good to know
- One EOS release: 4.36.2F, captured from a cEOS-lab node.
- This document only: a config is one device. A configlet gets warnings for objects defined elsewhere, but an error where EOS refuses the line (an undefined VRF, say).
- Semantics stay the switch's job: a bad password hash or a wrong
remote-as isn't flagged.
Settings
| Setting |
Default |
Controls |
eos.autoDetect |
true |
Detecting EOS configs by content |
eos.lint.enabled |
true |
Every diagnostic and the hover |
eos.lint.crossReference |
true |
The cross-reference checks and their quick fixes |
eos.lint.unused |
false |
Greying out unused definitions (needs eos.lint.crossReference) |
eos.completion.enabled |
true |
Keyword and name completion |
The extension's [eos] defaults: tabSize 3, insertSpaces on, detectIndentation off.
Install
- Open VSX (VSCodium, code-server, Gitpod, …): search the Extensions view (Ctrl+Shift+X / Cmd+Shift+X) for Arista EOS Config Linter (
packetanglers.eos-linter).
- VS Code: click Download on the Open VSX page, then pick the
.vsix in Extensions › … › Install from VSIX….
Requires VS Code 1.80+. Then open or paste a config: the status bar shows Arista EOS and checking starts.
What's next
- Hover help from the EOS manual
- A schema per EOS release, chosen by setting
- More modes (SRv6, RSVP, pseudowires)
- Fix-all, and removing unused or duplicate definitions
MIT License