Quick Start
Get up and running with FSH Lint in just a few minutes.
Prerequisites
Section titled “Prerequisites”- Rust 1.80 or later (if building from source)
- OR use pre-built binaries
Step 1: Install FSH Lint
Section titled “Step 1: Install FSH Lint”cargo install makiVerify the installation:
maki --versionStep 2: Initialize Configuration
Section titled “Step 2: Initialize Configuration”Create a default configuration file in your FSH project:
cd your-fsh-projectmaki initThis creates maki.json with recommended settings:
{ "$schema": "https://octofhir.github.io/maki/schema/v1.json", "root": true, "linter": { "enabled": true, "rules": { "recommended": true } }}Step 3: Lint Your Files
Section titled “Step 3: Lint Your Files”Lint all FSH files in the current directory:
maki lint **/*.fshOr lint specific files:
maki lint input/fsh/profiles.fshStep 4: Review Diagnostics
Section titled “Step 4: Review Diagnostics”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 8Step 5: Auto-fix Issues
Section titled “Step 5: Auto-fix Issues”Many issues can be fixed automatically:
maki lint --fix **/*.fshFSH Lint will apply safe fixes and report what was changed.
Step 6: Customize Rules
Section titled “Step 6: Customize Rules”Edit maki.json to customize rule behavior:
{ "linter": { "rules": { "recommended": true, "style": { "naming-convention": "error" // Upgrade to error }, "documentation": { "title-required": "off" // Disable this rule } } }}Next Steps
Section titled “Next Steps”- Configure rules to match your project’s needs
- Learn about built-in rules to understand what FSH Lint checks
- Write custom rules for project-specific validation
- Integrate with CI/CD to automate linting
Common Commands
Section titled “Common Commands”# Lint with automatic fixesmaki lint --fix **/*.fsh
# Lint and show only errorsmaki lint --severity error **/*.fsh
# List all available rulesmaki rules
# Get detailed information about a specific rulemaki rules --detailed style/naming-convention
# Format FSH filesmaki format **/*.fsh
# Format with automatic fixesmaki format --fix **/*.fshHelp and Support
Section titled “Help and Support”- Run
maki --helpfor command-line help - Run
maki <command> --helpfor command-specific help - Check the Troubleshooting Guide for common issues