mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #135] Should shared.js' createTokenCache not recreate an existing cache? #1962
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#1962
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 @JoshuaKGoldberg on GitHub (Jul 15, 2018).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/135
Context: I'm writing a custom rule and would like to use the
forEachLinemethod (#134). That method uses thetokenCachecreated bycreateTokenCache.If it just so happens that a custom rule's version of markdownlint is different from the package's, then
forEachLinewill crash as its version oftokenCachewon't exist. The solution is to manually callshared.createTokenCache()in the rule... but that seems wasteful for the general case of everyone using the same markdownlint version.@DavidAnson commented on GitHub (Jul 15, 2018):
Per #134, these functions are not public at present (partly due to challenges like this), so this scenario is not one that should be encountered.