Configuration Schema Reference
The FSH Lint configuration file has a JSON schema available for IDE autocomplete and validation.
Schema URL
Section titled “Schema URL”{ "$schema": "https://octofhir.github.io/fsh-lint-rs/schema/v1.json"}
Configuration Structure
Section titled “Configuration Structure”Root Configuration
Section titled “Root Configuration”interface Configuration { $schema?: string; root?: boolean; extends?: string[]; linter?: LinterConfiguration; formatter?: FormatterConfiguration; files?: FilesConfiguration;}
Linter Configuration
Section titled “Linter Configuration”interface LinterConfiguration { enabled: boolean; rules: RuleConfiguration; ruleDirectories?: string[];}
Rule Configuration
Section titled “Rule Configuration”interface RuleConfiguration { recommended?: boolean; style?: RuleSeverity | CategoryRules; documentation?: RuleSeverity | CategoryRules; correctness?: RuleSeverity | CategoryRules; suspicious?: RuleSeverity | CategoryRules;}
type RuleSeverity = "off" | "hint" | "info" | "warn" | "error";
Formatter Configuration
Section titled “Formatter Configuration”interface FormatterConfiguration { enabled: boolean; indentSize?: number; lineWidth?: number; useTabs?: boolean;}
Files Configuration
Section titled “Files Configuration”interface FilesConfiguration { include?: string[]; exclude?: string[]; ignoreFiles?: string[];}
Full Example
Section titled “Full Example”{ "$schema": "https://octofhir.github.io/fsh-lint-rs/schema/v1.json", "root": true, "extends": ["./base-config.json"],
"linter": { "enabled": true, "rules": { "recommended": true, "style": { "naming-convention": "error" }, "documentation": "warn", "correctness": "error" }, "ruleDirectories": ["./custom-rules"] },
"formatter": { "enabled": true, "indentSize": 2, "lineWidth": 100, "useTabs": false },
"files": { "include": ["**/*.fsh"], "exclude": [ "**/node_modules/**", "**/build/**", "**/temp/**" ] }}
IDE Support
Section titled “IDE Support”The schema enables:
- Autocomplete for configuration options
- Validation of configuration syntax
- Inline documentation
- Error detection
Supported in:
- VS Code
- JetBrains IDEs
- Any editor with JSON Schema support
Downloading the Schema
Section titled “Downloading the Schema”The schema is automatically served from GitHub Pages. For offline use:
curl -O https://octofhir.github.io/fsh-lint-rs/schema/v1.json
Then reference it locally:
{ "$schema": "./fsh-lint-schema.json"}