Expand description
§dprint-config
Strongly-typed configuration structs and JSON Schema for dprint formatter plugins (TypeScript, JSON, TOML, Markdown). Used by Lintel to pass user formatting options through to dprint.
§Features
- Typed configuration structs for dprint global settings and per-plugin options
- Covers TypeScript, JSON, TOML, and Markdown plugins
- Unknown plugins fall through to a generic
PluginConfigwith arbitrary settings - JSON Schema generation via
schemars #[no_std]compatible
§Usage
use dprint_config::DprintConfig;
let json = r#"{ "lineWidth": 100, "json": { "indentWidth": 4 } }"#;
let config: DprintConfig = serde_json::from_str(json).unwrap();
assert_eq!(config.line_width, Some(100));§License
Apache-2.0
Modules§
- json
- Configuration for the dprint JSON plugin.
- markdown
- Configuration for the dprint Markdown plugin.
- toml
- Configuration for the dprint TOML plugin.
- typescript
- Configuration for the dprint TypeScript / JavaScript plugin.
Structs§
- Dprint
Config - dprint configuration file (
dprint.json/.dprint.json). - Plugin
Config - Configuration for a dprint plugin not covered by the typed plugin structs.
Enums§
- Extends
- One or more configuration files to extend.
- NewLine
Kind - The newline character style to use when formatting files.
Functions§
- schema
- Generate the JSON Schema for
DprintConfigas aserde_json::Value.