mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #134] Is shared.js meant to be used externally? [Allow helper methods to be used by external rules] #1961
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#1961
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/134
I'm writing a custom rule, and it would be very useful to use methods such as
forEachLinein it. Is this file part of the public API?@DavidAnson commented on GitHub (Jul 15, 2018):
No, this is not public (so not exported or documented). That was deliberate to keep the surface area down, but I will use this issue to track the suggestion to make it public.
@JoshuaKGoldberg commented on GitHub (Jul 15, 2018):
In that case, +1 to making it public! I would hate to have to re-implement many of those methods externally.
You could also go with a tsutils approach of separating them out... but I would personally prefer keeping them here for simplicity's sake.
@DavidAnson commented on GitHub (Jul 15, 2018):
Understood! (Offhand, I think the tsutils approach may be more stable from a versioning POV so that extensions aren’t tied to a specific version of the library.)
@byzyk commented on GitHub (Oct 29, 2018):
+1
While working on the custom rule I've found some of the shared helpers' methods quite handy. I had to copy/paste them but I think they should be accessible for everyone
@DavidAnson commented on GitHub (Apr 13, 2019):
shared.js is now available as
markdownlint-rule-helpers:https://www.npmjs.com/package/markdownlint-rule-helpers