dprint-config 0.0.1

Strongly-typed configuration structs and JSON Schema for dprint formatter plugins (TypeScript, JSON, TOML, Markdown). Used by [Lintel](https://github.com/lintel-rs/lintel) to pass user formatting options through to dprint.
Documentation

dprint-config

Crates.io docs.rs GitHub License

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 PluginConfig with 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