Skip to content

fix: update dprint-core to 0.75.2 and add code examples to the config schema - #14

Merged
dsherret merged 1 commit into
mainfrom
schema-examples
Nov 6, 2026
Merged

dsherret merged 1 commit into
mainfrom
schema-examples

Conversation

@dsherret

@dsherret dsherret commented Nov 5, 2026

Copy link
Copy Markdown
Member

Updates dprint-core to 0.75.2, which has fixes for the performance of the printer and no API changes.

Also improves the configuration documentation that dprint.dev renders from schema.json, using keywords that validators and editors ignore:

  • x-playground at the root: unformatted TypeScript that the dprint.dev playground starts with when this plugin is selected.
  • x-example on 32 properties: input code that's formatted with each of the property's values. The repo's schema.json only has the inputs. The outputs are generated with the built plugin when the schema is published. The options of the Prettier plugins set plugins in the example's config, and the ones for other languages set an extension (tsx, html, vue, md, svelte).
  • x-sections at the root: the properties grouped into nine sections (General, Pragmas, JavaScript and TypeScript, JSX/HTML/Vue, Markdown, Svelte, Prettier plugins, oxfmt, Languages).

There are no x-overrides, since no option defaults to the value of another one.

Other schema changes:

  • printWidth and tabWidth are integer with a minimum of 0 (and a maximum of 255 for tabWidth), which is what the plugin accepts.
  • Describes each value of importOrderSortByLength, importOrderImportAttributesKeyword, organizeImportsTypeOrder, and the commentLineStrategy and lineWrappingStyle of jsdoc, and the options of svelte.

CI

The new "Generate config schema" step runs the publish-schema task from dprint/automation on the built wasm plugin, before the schema is uploaded to a release. It adds the example outputs and each example's file extension, and fails when the plugin has a diagnostic for a property's default, an example formats the same with every value, a top level property isn't in exactly one section, or the playground's code doesn't format or is already formatted.

To see the generated schema locally:

deno task setup
cargo build --target wasm32-unknown-unknown --features wasm --release
cp deployment/schema.json /tmp/schema.json
deno run -A jsr:@dprint/automation@0.14.3/tasks/publish-schema target/wasm32-unknown-unknown/release/dprint_plugin_bun.wasm /tmp/schema.json --extension ts

@dsherret
dsherret merged commit 746405b into main Nov 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant