dprint-plugin-markdown icon indicating copy to clipboard operation
dprint-plugin-markdown copied to clipboard

add support for spaces

Open ivanhofer opened this issue 3 years ago • 1 comments

I have configured dprint to use tabs to format my source code, but for markdown files I want to use spaces, because tabs have an ugly indent level on npmjs.com. I would expect that overriding the config for markdown files would work:

.dprint.json

{
	"$schema": "https://plugins.dprint.dev/dprint/dprint-plugin-json/latest/schema.json",
	"useTabs": true,
+	"markdown": {
+		"useTabs": false
+	},
	"plugins": [
		"https://plugins.dprint.dev/markdown-0.14.1.wasm"
	]
}

But when running dprint format I get the following error:

> dprint fmt

[dprint-plugin-markdown]: Unknown property in configuration: useTabs (useTabs)
[dprint-plugin-markdown]: Error initializing from configuration file. Had 1 diagnostic(s).
Had 1 error(s) formatting.
 ELIFECYCLE  Command failed with exit code 1.

I can set useTabs to false globally, but not just for markdown files.

ivanhofer avatar Oct 22 '22 10:10 ivanhofer

My problem is the exact opposite. I want tab indentation in markdown, but useTabs doesn't affect the markdown plugin at all. See this playground snippet. Could there be / is there currently at least an option to disable indent fixing while tabs are not supported?

Maybe this can be addressed together with Add support for identation size · Issue #78. Here's some more discussion on why some people want tabs.

NomarCub avatar May 06 '23 07:05 NomarCub