Format code with dprint.
Run dprint to format code.
{
"@ben_12/dprint/markdown": [
"error",
{
// Use dprint JSON configuration file (default: "dprint.json")
// It may be created using `dprint init` command
// See also https://dprint.dev/config/
"configFile": "dprint.json",
"config": {
// The markdown configuration of dprint
// See also https://dprint.dev/plugins/markdown/config/
},
},
],
}
The plugin can also be given a pre-resolved dprint formatter via ESLint’s settings, which is
useful when the dprint plugin packages are not directly require()-able (e.g. bundled configs).
See the main README for the full
explanation and the accepted shapes. Minimal example for this rule:
import markdownFormatter from "@dprint/markdown";
export default [{
settings: {
"@ben_12/dprint": {
formatters: { markdown: markdownFormatter },
},
},
rules: {
"@ben_12/dprint/markdown": ["error", { config: { /* dprint config */ } }],
},
}];