eslint-plugin-dprint

@ben_12/dprint/markdown

Format code with dprint.

Rule Details

Run dprint to format code.

Options

{
  "@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/
      },
    },
  ],
}

Pre-resolved formatter

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 */ } }],
  },
}];