Skip to content

Editor Integration

Enable FSH Lint in your favorite editor for real-time linting feedback.

Install the FSH extension:

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for “FSH Language Support”
  4. Install the extension

Add to .vscode/settings.json:

{
"fsh.lint.enabled": true,
"fsh.lint.run": "onType",
"fsh.lint.path": "fsh-lint",
"fsh.lint.autoFixOnSave": true
}

Create .vscode/tasks.json:

{
"version": "2.0.0",
"tasks": [
{
"label": "FSH Lint",
"type": "shell",
"command": "fsh-lint",
"args": ["lint", "${workspaceFolder}/**/*.fsh"],
"problemMatcher": []
}
]
}
  1. Go to Settings → Tools → File Watchers
  2. Click ”+” to add new watcher
  3. Configure:
    • Name: FSH Lint
    • File type: FSH (or Custom)
    • Scope: Project Files
    • Program: fsh-lint
    • Arguments: lint --fix $FilePath$
    • Working directory: $ProjectFileDir$

Add to .vimrc or init.vim:

let g:ale_linters = {
\ 'fsh': ['fsh-lint'],
\}
let g:ale_fixers = {
\ 'fsh': ['fsh-lint'],
\}
let g:ale_fix_on_save = 1

Coming soon - LSP server for FSH Lint.

Add to your Emacs config:

(require 'flycheck)
(flycheck-define-checker fsh-lint
"FSH linter using fsh-lint."
:command ("fsh-lint" "lint" source)
:error-patterns
((error line-start (file-name) ":" line ":" column ": error: " (message))
(warning line-start (file-name) ":" line ":" column ": warning: " (message)))
:modes (fsh-mode))
(add-to-list 'flycheck-checkers 'fsh-lint)
  1. Install SublimeLinter package
  2. Create plugin at Packages/User/linter_fsh.py:
from SublimeLinter.lint import Linter
class FshLint(Linter):
cmd = 'fsh-lint lint ${file}'
regex = r'^.+:(?P<line>\d+):(?P<col>\d+):\s+(?:(?P<error>error)|(?P<warning>warning)):\s+(?P<message>.+)$'
tempfile_suffix = 'fsh'

For editors without specific plugins:

Configure your editor to run on save:

Terminal window
fsh-lint lint --fix /path/to/file.fsh

Set up FSH Lint as an external tool with:

  • Command: fsh-lint
  • Arguments: lint --fix $FILE
  • Working directory: $PROJECT_DIR
FeatureVS CodeJetBrainsVimEmacsSublime
Syntax Highlighting
Real-time Linting
Auto-fix on Save-
Quick Fixes----
Rule Documentation----

Add to your editor’s PATH or specify full path:

{
"fsh.lint.path": "/usr/local/bin/fsh-lint"
}

Adjust lint frequency:

{
"fsh.lint.run": "onSave" // Instead of "onType"
}