mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #927] How to fix everything what is possible when using a files option? #554
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#554
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jcubic on GitHub (Aug 10, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/927
How to fix what is possible when using
default: true? Do I need to duplicate every single rule to add fixInfo? There should be a way to make it fix what it can by default.I've found this issue #663 but I'm not sure how to use this API if I have this config:
It seems that
markdownlintRuleHelpers.applyFixesrequires{ content: string }but I have a file.I've also tried this:
but this give an error:
@jcubic commented on GitHub (Aug 10, 2023):
So I was able to figure this out:
Do you want me to add this to docs? If yes then where I should add this code?
@DavidAnson commented on GitHub (Aug 10, 2023):
Issue #663 that you link to gives context and references a commit that adds an explanation and an example to the documentation:
@jcubic commented on GitHub (Aug 11, 2023):
But it only shows how to fix a single string. It doesn't show to fix the files. You need to figure that out on your own.
Another option is to show what is the return value of sync, which is also not documented.
@DavidAnson commented on GitHub (Aug 11, 2023):
Types for markdownlint's sync API are available here:
github.com/DavidAnson/markdownlint@d641caf90c/lib/markdownlint.d.ts (L74)And described here: https://github.com/DavidAnson/markdownlint#usage
@jcubic commented on GitHub (Aug 11, 2023):
Sorry, but I don't see documentation on how to call
applyFixeswith an output ofmarkdownlint. As I said there are only docs how to call it with string.@DavidAnson commented on GitHub (Aug 11, 2023):
There is documentation to describe and demonstrate various ways of giving input into the tool as well as how to interpret the output, including fixing issues. There may not be an example that corresponds precisely to your scenario.
From what I can see above, what's missing is code to read and write each file. Those are standard Node APIs and examples exist in their documentation and elsewhere.