Skip to content

Quick Start

Get up and running with FSH Lint in just a few minutes.

  • Rust 1.80 or later (if building from source)
  • OR use pre-built binaries
Terminal window
cargo install fsh-lint

Verify the installation:

Terminal window
fsh-lint --version

Create a default configuration file in your FSH project:

Terminal window
cd your-fsh-project
fsh-lint init

This creates fsh-lint.json with recommended settings:

{
"$schema": "https://octofhir.github.io/fsh-lint-rs/schema/v1.json",
"root": true,
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}

Lint all FSH files in the current directory:

Terminal window
fsh-lint lint **/*.fsh

Or lint specific files:

Terminal window
fsh-lint lint input/fsh/profiles.fsh

FSH Lint will show you any issues found:

error[correctness/duplicate-definition]: Duplicate profile definition
> 15 │ Profile: PatientProfile
│ ^^^^^^^^^^^^^^ Profile 'PatientProfile' is already defined
16 │ * name 1..1 MS
i First defined at line 8

Many issues can be fixed automatically:

Terminal window
fsh-lint lint --fix **/*.fsh

FSH Lint will apply safe fixes and report what was changed.

Edit fsh-lint.json to customize rule behavior:

{
"linter": {
"rules": {
"recommended": true,
"style": {
"naming-convention": "error" // Upgrade to error
},
"documentation": {
"title-required": "off" // Disable this rule
}
}
}
}
Terminal window
# Lint with automatic fixes
fsh-lint lint --fix **/*.fsh
# Lint and show only errors
fsh-lint lint --severity error **/*.fsh
# List all available rules
fsh-lint rules
# Get detailed information about a specific rule
fsh-lint rules --detailed style/naming-convention
# Format FSH files
fsh-lint format **/*.fsh
# Format with automatic fixes
fsh-lint format --fix **/*.fsh
  • Run fsh-lint --help for command-line help
  • Run fsh-lint <command> --help for command-specific help
  • Check the Troubleshooting Guide for common issues