dprint-plugin-pug 0.1.0

A super minimal Pug formatter plugin for dprint.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Configuration {
    pub indent_width: Option<usize>,
    pub use_tabs: Option<bool>,
}

impl Configuration {
    pub fn indent_width(&self) -> usize {
        self.indent_width.unwrap_or(2)
    }

    pub fn use_tabs(&self) -> bool {
        self.use_tabs.unwrap_or(false)
    }
}