MCPcopy Index your code
hub / github.com/dprint/dprint-plugin-prettier

github.com/dprint/dprint-plugin-prettier @0.72.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.72.0 ↗ · + Follow
55 symbols 112 edges 22 files 3 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dprint-plugin-prettier

CI

Wrapper around prettier in order to use it as a dprint plugin.

Install

  1. Install dprint
  2. Run dprint init to create the config file.
  3. Run dprint add prettier to add this plugin.

Configuration

See Prettier's configuration here. Specify using the "API Override" column.

{
  // ...etc...
  "prettier": {
    "trailingComma": "all",
    "singleQuote": true,
    "proseWrap": "always",
    // enable prettier-plugin-jsdoc
    "plugin.jsDoc": true,
  },
}

File extension specific configuration

Add the file extension to the start of the configuration option. For example:

{
  // ...etc...
  "prettier": {
    "singleQuote": true,
    // use double quotes in js files
    "js.singleQuote": false,
    // use double quotes in ts files
    "ts.singleQuote": false,
  },
}

Included Prettier Plugins

Temporarily removed, but will be added back soon:

See issue #55 for the new plugin system.

Why Does This Exist?

The main reason this exists is to be able to use Prettier with dprint's CLI. That way, you can format with all the plugins that dprint supports, still use Prettier, and only have to run dprint fmt.

Additionally it's much faster. This plugin will format files in parallel and you can take advantage of the speed of dprint's incremental formatting if enabled.

Extension points exported contracts — how you extend this code

Formatter (Interface)
(no doc) [1 implementers]
base/src/channel.rs
FormatTextOptions (Interface)
(no doc)
js/node/main.ts
PluginsConfig (Interface)
(no doc)
js/node/main.ts

Core symbols most depended-on inside this repo

create_tokio_runtime
called by 6
base/src/util.rs
execute_script
called by 4
base/src/runtime.rs
format
called by 3
plugin/src/handler.rs
get_startup_text
called by 2
plugin/build.rs
resolve_config
called by 2
plugin/src/config.rs
addForLanguage
called by 2
js/node/main.ts
get_platform
called by 2
base/src/runtime.rs
create_snapshot
called by 1
plugin/build.rs

Shape

Function 26
Method 16
Class 10
Interface 3

Languages

Rust85%
TypeScript15%

Modules by API surface

base/src/runtime.rs8 symbols
base/src/channel.rs8 symbols
plugin/src/handler.rs7 symbols
js/node/main.ts6 symbols
plugin/src/formatter.rs5 symbols
plugin/src/config.rs4 symbols
plugin/build.rs4 symbols
base/src/util.rs4 symbols
plugin/tests/tests.rs3 symbols
scripts/update.ts2 symbols
base/src/build.rs2 symbols
plugin/src/main.rs1 symbols

For agents

$ claude mcp add dprint-plugin-prettier \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page