Arista EOS Config Linter

Find the line the switch would refuse before you push it.
Running-configs, AVD output, config snippets and change scripts are checked as you type against EOS's own command tree, offline. Two sources of truth: the EOS User Manual, and nodes running EOS 4.36.2F and 4.37.0F, where every rule was measured. An error means EOS refuses the line. A warning means EOS accepts it, or may, but something is off.
- Catch refusals before you push. Typos, out-of-range values, lines in the wrong block,
no lines EOS won't take, undefined VRFs: flagged as you type.
- The switch's answers, in your editor. Completion that mirrors
?, hovers with the exact syntax, and quick fixes for a missing name or VLAN.
- Navigate and refactor like code. Go to Definition and Find References across 85 kinds of names, and a Rename (F2) that never half-finishes.
- Both releases, or yours. By default a line either 4.36.2F or 4.37.0F takes is clean; pick yours, or 4.37.0F to preview an upgrade.
Nothing to set up, no new keys: open or paste a config and problems underline as you type. Hover a line for its syntax; F12 jumps to a definition, F2 renames, Ctrl+. offers a fix for an undefined name (on macOS, Cmd for Ctrl). Not on VS Code? The same checks run in Neovim, Vim, Emacs and Helix (Other editors).
Catch refusals before you push
Every line is checked in its mode a quarter-second after you pause:
- Typos:
switchport mode trunkk → … did you mean trunk?
- Values: numbers in range, addresses, prefixes, MACs.
vrrp 1 priority-level 300 → … 300 is out of range: PRIORITY runs from 1 to 254
- The wrong block:
ip address under vlan 10 → … it is valid in interface — is this line indented wrong?
- Interfaces:
interface Etgghernety1 gets the list of valid types; evpn ethernet-segment under a Loopback → … a Loopback interface's ? lists no evpn
- Ambiguous abbreviations:
sw mo tr is fine, but a lone s under an interface → Ambiguous command s in interface: it abbreviates service-policy, …
- BGP communities of every kind, route targets, bandwidths and regexes, held to the switch's bounds:
ip community-list L1 permit 65536:1 → … each half of aa:nn runs from 0 to 65535
no and default lines, checked against the switch's own syntax for undoing the command (its no-form): no vlan → … Expected no vlan VLAN_SET
- Long commands, to the end, past where EOS's own command list cuts them (
...).
- Text blocks: a
banner with no EOF.
- Cross-references, at the switch's severity: undefined names, undeclared VLANs, duplicate addresses, double definitions. An error only where EOS refuses the line, else a warning:
- 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
As lenient as the switch
- Quiet where EOS is: hidden commands (
channel-protocol lacp), free text (radius-server key my shared secret), the words EOS ignores after a complete no (no mtu 9214 extra words) and do show running-config stay clean, and a show clock left in a paste is a warning to remove, not an error.
- Follows the mode, not your indentation: flat snippets and change scripts lint as the switch reads them, RCF code units, block edits and hardware blocks too, with a warning to indent a line under the block EOS applies it to. Just paste.
- When the config can't show whether the switch took an earlier line, a later line is an error only if wrong both ways, and a warning naming that earlier line if wrong one way only.
- Platform checks, opt-in (
"eos.lint.platformFeatures": true): a warning on commands not every platform has (sflow hardware acceleration, hardware tcam, poe) and a hint on an mtu above 9000.
- One config is one device: a snippet gets warnings for objects defined elsewhere, and errors only where EOS refuses the line regardless (an undefined VRF). Semantics stay the switch's job: a bad password hash or a wrong
remote-as isn't flagged.
Both EOS releases, or the one you run
What each value of eos.release checks:
any (the default): a line either release takes is clean, 4.37.0F's new commands included.
4.37.0F: what a 4.37.0F switch refuses, down to a stray line in most hardware blocks (hardware tcam, PoE, NAT, qos scheduling). Preview an upgrade: the qos map dei 1 to drop-precedence 2 it removed is an error.
4.36.2F: what a 4.36.2F switch refuses, 4.37.0F's management cloud gateway among them; hardware blocks and hardware-only commands stay as lenient as in any.
Switch from the status bar (EOS 4.36.2F + 4.37.0F by default) or Arista EOS: Select EOS Release (Ctrl+Shift+P); completion, hover, quick fixes, Go to Definition and Rename follow your pick, and the hover says when only your pick refuses a line. Not sure? Leave it on any; if your switch takes a line a release marks, set it back to any.
The switch's answers, in your editor
- Type a word and a space: completion offers what the switch's
? lists in this mode, plus this document's names of the right kind; sw mo and a space gets what switchport mode gets.
- Hover a line for its mode and the exact syntax it matched, why a check was skipped, and the basis of a cross-reference finding.
- Messages in the switch's words, pointing at the right spot:
ip route 10.1.1.0/24 Null0 community 65536:1 blames the community, not the distance.
- Ctrl+. on an undefined name or VLAN: Change to RM-OUT for a near miss, Create route-map RM_OUT (the smallest definition EOS accepts) or Declare VLAN 30; on a leftover RCF
compile or a show line, Remove it. Each is one undoable edit.
- Policy and access stay your call: a created route-map, ACL or the like opens in Refactor Preview unticked, since it can permit or drop everything: tick, then Apply. Credentials and
router bgp are never created.
Navigate and refactor like code
- F12 jumps to a definition across 85 kinds of names (VRFs, route-maps, ACLs, peer groups, interfaces, RCF functions, …), matched as EOS matches them:
et 12 finds interface Ethernet12.
- Shift+F12 finds every reference, even to a name never defined here (inside a code unit, only a function's), and the cursor on a name highlights them all.
- Rename with F2, never half-finished: a VRF across interfaces, BGP and static routes, or an interface in any spelling, in one undoable edit. Where it can't be complete and right, F2 refuses and says why.
- Unused definitions, greyed out, for a tidy-up (
"eos.lint.unused": true).
- Outline and breadcrumbs, nested as the config nests:
router bgp 65100 › vrf Tenant_A › address-family ipv4.
- Exact folding: Fold All leaves one line per block.
- Made for EOS: highlighting for names, interfaces, addresses, secrets, banners,
action bash and RCF; 3-space indent, auto-indent and ! comments; a double-click grabs 10.255.0.3/32 whole.
- Knows an EOS config:
running-config, startup-config and *.eos files open as EOS, and a .cfg, .conf, .txt or untitled paste switches when its content is EOS; an IOS, NX-OS or Junos config never does.
Routing Control Functions (RCF)
- Checked like the compiler: inside
code unit … EOF, indented or flat, in the spellings EOS takes (CODE UNIT U, cod u U), its errors are the compiler's own messages at their positions (… undefined reference to attribute 'potato'), sets, ranges and literals are held to its bounds, and completion and hover know every attribute.
- Functions as names: where a command takes
rcf, your functions complete (fallback chains too, where EOS takes them), and F12, Shift+F12 and F2 follow one into its code unit; a word the switch refuses there is an error (rcf A() and B()).
- Warnings, as the switch treats them: an undefined function, a route-map an RCF function overrides, an undefined prefix-list in a function (an error on
4.36.2F under command rcf external reference unconfigured action error, as its compile fails), and a leftover compile session command (Ctrl+. removes it).
Using it
Every key is VS Code's own; the extension adds no keybinding. On macOS, press Cmd for Ctrl and Option for Alt; completion stays Ctrl+Space.
| To |
Keys |
| See problems / jump to the next |
Ctrl+Shift+M / F8 |
| Quick fix |
Ctrl+. or the lightbulb |
| Complete |
Ctrl+Space, or a word and a space |
| Hover |
Mouse, or Ctrl+K Ctrl+I |
| Go to Definition |
F12 or Ctrl+click |
| Peek Definition |
Alt+F12 (Linux: Ctrl+Shift+F10) |
| Find References |
Shift+F12 |
| Rename |
F2 |
| Go to Symbol |
Ctrl+Shift+O |
| Fold All / Unfold All |
Ctrl+K Ctrl+0 / Ctrl+K Ctrl+J |
Toggle ! comment |
Ctrl+/ |
| Select EOS Release |
Click the release in the status bar, or Ctrl+Shift+P › Select EOS Release |
File switched to EOS by mistake? Ctrl+K M sets it back, and it stays while open; View › Output › EOS Linter says why it switched. To make a folder's files EOS: "files.associations": { "**/intended/configs/*.cfg": "eos" }.
Settings
| Setting |
Default |
Controls |
eos.release |
any |
The release: any (a line either release takes is clean), 4.36.2F or 4.37.0F |
eos.lint.enabled |
true |
Every diagnostic, and the hover |
eos.lint.crossReference |
true |
Undefined names, undeclared VLANs and duplicates, with their quick fixes |
eos.lint.unused |
false |
Greying out unused definitions (needs eos.lint.crossReference) |
eos.lint.platformFeatures |
false |
Platform warnings and the mtu-above-9000 hint |
eos.completion.enabled |
true |
Keyword and name completion |
eos.autoDetect |
true |
Switching a Plain Text, Properties or Ini document to EOS when its content is EOS |
Defaults for [eos]: tabSize 3, insertSpaces on, detectIndentation off. For the switch's words alone in completion: "[eos]": { "editor.wordBasedSuggestions": "off" }.
Install
- VS Code: in the Extensions view (Ctrl+Shift+X / Cmd+Shift+X), search for Arista EOS Config Linter (
packetanglers.eos-linter) and click Install, or open its Marketplace page.
- VSCodium, code-server, Gitpod and other Open VSX editors: the same search, or the Open VSX page.
Requires VS Code 1.91 or newer. The language server and both releases' command data ship inside: nothing else to install.
Other editors
Neovim, Vim, Emacs and Helix get the same checks, hover, completion, navigation, quick fixes and rename from eos-language-server on npm (Node.js 18 or newer). Its npm page has a setup for each, release switching included; no EOS syntax highlighting.
npm install -g eos-language-server
Coming next: a mixed fleet checked in one pass (an error where either release refuses the line), community checks confirmed on hardware, route distinguisher (rd) checks, a quick fix that writes a missing RCF function, and hover help from the EOS User Manual.
Release highlights: CHANGELOG.md, the Changelog tab in VS Code. MIT License.
| |