Configuration File
FSH Lint uses a fsh-lint.json
or fsh-lint.jsonc
configuration file.
Creating a Config File
Section titled “Creating a Config File”Run the init command to create a default configuration:
fsh-lint init
This creates fsh-lint.json
in your current directory with recommended defaults.
Config File Format
Section titled “Config File Format”Basic Configuration
Section titled “Basic Configuration”{ "$schema": "https://octofhir.github.io/fsh-lint-rs/schema/v1.json", "root": true, "linter": { "enabled": true, "rules": { "recommended": true } }}
Full Configuration
Section titled “Full Configuration”{ "$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/**"] }}
Configuration Options
Section titled “Configuration Options”Schema Reference
Section titled “Schema Reference”The $schema
field enables IDE autocomplete and validation:
{ "$schema": "https://octofhir.github.io/fsh-lint-rs/schema/v1.json"}
Root Flag
Section titled “Root Flag”Set root: true
to stop upward config file search:
{ "root": true}
Extends
Section titled “Extends”Inherit from other config files:
{ "extends": ["./base.json", "@my-org/fsh-config"]}
Auto-Discovery
Section titled “Auto-Discovery”FSH Lint automatically searches for config files by:
- Starting from current directory
- Looking for
fsh-lint.jsonc
orfsh-lint.json
- Moving up to parent directories
- Stopping at
root: true
or filesystem root
JSONC Support
Section titled “JSONC Support”Use comments and trailing commas in .jsonc
files:
{ // This is a comment "linter": { "enabled": true, // Trailing comma OK }}