Skip to content

Commit

Permalink
chore: update internal plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jul 11, 2024
1 parent f0af327 commit b42c9db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ This plugin executes CLI commands to format code via stdin (recommended) or via
{
// ...etc...
"exec": {
// lets the plugin know the cwd, see https://dprint.dev/config/#configuration-variables
"cwd": "${configDir}",

// general config (optional -- shown are the defaults)
"lineWidth": 120,
"indentWidth": 2,
"useTabs": false,
"cacheKey": "1",
"timeout": 30,

// you may need to set this for when the dprint executable has a different
// cwd than this configuration file (see https://dprint.dev/config/#configuration-variables)
"cwd": "${configDir}",

// now define your commands, for example...
"commands": [{
"command": "rustfmt",
Expand Down Expand Up @@ -96,6 +95,7 @@ Command templates (ex. see the prettier example above):
{
// ...etc...
"exec": {
"cwd": "${configDir}",
"commands": [{
"command": "java -jar formatter.jar {{file_path}}",
"exts": ["java"]
Expand All @@ -115,8 +115,8 @@ Use the `rustfmt` binary so you can format stdin.
{
// ...etc...
"exec": {
"cwd": "${configDir}",
"commands": [{
"cwd": "${configDir}",
"command": "rustfmt --edition 2021",
"exts": ["rs"]
}]
Expand All @@ -135,6 +135,7 @@ Consider using [dprint-plugin-prettier](https://dprint.dev/plugins/prettier/) in
{
// ...etc...
"exec": {
"cwd": "${configDir}",
"commands": [{
"command": "prettier --stdin-filepath {{file_path}} --tab-width {{indent_width}} --print-width {{line_width}}",
// add more extensions that prettier should format
Expand Down
11 changes: 6 additions & 5 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"indentWidth": 2,
"lineWidth": 100,
"exec": {
"cwd": "${configDir}",
"commands": [{
"command": "rustfmt --edition 2021 --config imports_granularity=item",
"exts": ["rs"]
Expand All @@ -14,10 +15,10 @@
"**/*-lock.json"
],
"plugins": [
"https://plugins.dprint.dev/json-0.17.4.wasm",
"https://plugins.dprint.dev/markdown-0.15.3.wasm",
"https://plugins.dprint.dev/toml-0.5.4.wasm",
"https://plugins.dprint.dev/exec-0.4.2.json@ca3c3d1cc1105b4ac1c31afdb26791a90209f13a5950f8de00dcab5e5ee293a7",
"https://plugins.dprint.dev/typescript-0.88.3.wasm"
"https://plugins.dprint.dev/json-0.19.3.wasm",
"https://plugins.dprint.dev/markdown-0.17.1.wasm",
"https://plugins.dprint.dev/toml-0.6.2.wasm",
"https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0",
"https://plugins.dprint.dev/typescript-0.91.3.wasm"
]
}

0 comments on commit b42c9db

Please sign in to comment.