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

remark config is ignored when formatting #123

Closed
4 tasks done
qyurila opened this issue Oct 4, 2022 · 4 comments
Closed
4 tasks done

remark config is ignored when formatting #123

qyurila opened this issue Oct 4, 2022 · 4 comments
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on

Comments

@qyurila
Copy link

qyurila commented Oct 4, 2022

Initial checklist

Affected packages and versions

vscode-remark v2.1.0

Link to runnable example

No response

Steps to reproduce

  1. Create following package.json file and run pnpm install (or npm install):

package.json

{
	"devDependencies": {
		"remark": "^14.0.2",
		"remark-cli": "^11.0.0",
		"remark-preset-lint-markdown-style-guide": "^5.1.2"
	},
	"remarkConfig": {
		"plugins": [
			"remark-preset-lint-markdown-style-guide"
		]
	}
}
  1. Create any markdown file e.g.

test.md

- item 1
-  item 2
  1. Run VSCode command 'Format Document', or 'Format Document...' (if present) and select 'remark' to format a markdown file.

Expected behavior

test.md should be formatted using configured options, resulting:

- item 1
- item 2

Actual behavior

test.md is formatted using remark's default options, resulting:

*   item 1
*   item 2

...and VSCode shows following warnings (which are parts of remark-preset-lint-markdown-style-guide):

Marker style should be `-` remark-lint(unordered-list-marker-style)
Incorrect list-item indent: remove 2 spaces remark-lint(list-item-indent)

This means vscode-remark recognises remarkConfig but ignores them when formatting.

The same thing happens with .remarkrc (etc.) file.

I'm not sure if this is a bug or a missing feature, but I think the formatting feature meant be configurable regarding to #13.

Runtime

Node v16

Package manager

pnpm

OS

Windows

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Oct 4, 2022
@qyurila
Copy link
Author

qyurila commented Oct 5, 2022

I found that it's remark-cli what ignores config when making output. Perhaps I was overlooking something. Sorry for bothering.

@qyurila qyurila closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2022
@github-actions

This comment has been minimized.

@qyurila
Copy link
Author

qyurila commented Oct 5, 2022

Extra infomations I found (might wrong) for any future wonderers:

remark-lint has no auto-fix feature (currently): see remarkjs/remark-lint#82.

--out option of remark makes output file(s) based on remarkConfig.settings (which determines remark-stringify's behaviour) only, not on any remark-lint presets and rules.

So, if you want to auto-format your .md files with this extension (or remark * --out) based on, let's say, remark-preset-lint-markdown-style-guide, you have to configure remarkConfig.settings options too even if it seems like duplicating.

@wooorm
Copy link
Member

wooorm commented Oct 5, 2022

Yep, the lint rules are different from the formatting package. I believe there are issues open on improving this!

@wooorm wooorm added 👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on labels Oct 5, 2022
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants