Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for spaces #68

Open
ivanhofer opened this issue Oct 22, 2022 · 1 comment
Open

add support for spaces #68

ivanhofer opened this issue Oct 22, 2022 · 1 comment

Comments

@ivanhofer
Copy link

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.

@NomarCub
Copy link

NomarCub commented May 6, 2023

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.

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

No branches or pull requests

2 participants