Skip to content

Configuration File

FSH Lint uses a fsh-lint.json or fsh-lint.jsonc configuration file.

Run the init command to create a default configuration:

Terminal window
fsh-lint init

This creates fsh-lint.json in your current directory with recommended defaults.

{
"$schema": "https://octofhir.github.io/fsh-lint-rs/schema/v1.json",
"root": true,
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
{
"$schema": "https://octofhir.github.io/fsh-lint-rs/schema/v1.json",
"root": true,
// Extend from base config
"extends": ["./configs/base.json"],
"linter": {
"enabled": true,
"rules": {
// Enable all recommended rules
"recommended": true,
// Configure specific rules
"correctness": {
"duplicate-definition": "error",
"required-fields": "warn"
},
"style": {
"naming-convention": "warn"
}
},
// Load custom GritQL rules
"ruleDirectories": ["./custom-rules"]
},
"formatter": {
"enabled": true,
"indentSize": 2,
"lineWidth": 100
},
"files": {
"include": ["**/*.fsh"],
"exclude": ["**/node_modules/**", "**/temp/**"]
}
}

The $schema field enables IDE autocomplete and validation:

{
"$schema": "https://octofhir.github.io/fsh-lint-rs/schema/v1.json"
}

Set root: true to stop upward config file search:

{
"root": true
}

Inherit from other config files:

{
"extends": ["./base.json", "@my-org/fsh-config"]
}

FSH Lint automatically searches for config files by:

  1. Starting from current directory
  2. Looking for fsh-lint.jsonc or fsh-lint.json
  3. Moving up to parent directories
  4. Stopping at root: true or filesystem root

Use comments and trailing commas in .jsonc files:

{
// This is a comment
"linter": {
"enabled": true, // Trailing comma OK
}
}