mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 17:56:02 +03:00
[GH-ISSUE #510] Asynchronous Rule's params.config will be overrided by other sync rules. #416
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#416
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 @chriswong on GitHub (Mar 20, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/510
Source Code:
markdownlint.js#L505
markdownlint.js#L600
Reproduction
@chriswong commented on GitHub (Mar 20, 2022):
Fixed Code
markdownlint.js#L505
markdownlint.js#L600
@DavidAnson commented on GitHub (Mar 20, 2022):
This is a good find, thank you! I started freezing the
paramsobject to prevent issues like this, but did not catch this scenario:github.com/DavidAnson/markdownlint@5f0040679d.I'm curious why I never saw this during development - and whether that means it will be hard to test for.
@DavidAnson commented on GitHub (Mar 20, 2022):
(The synchronous part of custom rules is deliberately (supposed to be) deterministic, so I'm surprised by this.)
@DavidAnson commented on GitHub (Mar 20, 2022):
Nope, I see this affects even the "synchronous" path. I'm adding tests now and hope to fix this shortly. Sorry about the error, I don't see a good workaround at the moment! How urgent is this and are you using any dependent projects like CLI/CLI2, VS Code extension, etc.?
@DavidAnson commented on GitHub (Mar 21, 2022):
I thought of a workaround: Also create a synchronous rule that does nothing and pass the parameter to it and then share that parameter value across the two rules either in the same file or via a shared import.
@chriswong commented on GitHub (Mar 29, 2022):
Yes, i'm working on my vscode extension, for linting html/style/script code in markdown:
So, we'd like to know when the next version could be published?
@DavidAnson commented on GitHub (Mar 29, 2022):
Are you consuming the library directly or are you integrating with https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
@chriswong commented on GitHub (Mar 29, 2022):
We're consuming the library directly.
@DavidAnson commented on GitHub (Mar 29, 2022):
Good, the library comes out first. Did you try the workaround I mention above? It should unblock you for now.
@chriswong commented on GitHub (Mar 29, 2022):
Yes, it works.