question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is shared.js meant to be used externally? [Allow helper methods to be used by external rules]

See original GitHub issue

I’m writing a custom rule, and it would be very useful to use methods such as forEachLine in it. Is this file part of the public API?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidAnsoncommented, Apr 13, 2019

shared.js is now available as markdownlint-rule-helpers: https://www.npmjs.com/package/markdownlint-rule-helpers

1reaction
byzykcommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sharing JavaScript Code in a Component Bundle
A helper function can pass in any arguments required by the function, such as the component it belongs to, a callback, or any...
Read more >
Should private helper methods be static if they can be static
I prefer such helper methods to be private static ; which will make it clear to the reader that they will not modify...
Read more >
JavaScript best practices - W3C Wiki
Global variables and function names are an incredibly bad idea. The reason is that every JavaScript file included in the page runs in...
Read more >
Variable scope, closure - The Modern JavaScript Tutorial
A closure is a function that remembers its outer variables and can access them. In some languages, that's not possible, or a function...
Read more >
Functions — reusable blocks of code - Learn web development
In this article we'll explore fundamental concepts behind functions such as basic syntax, how to invoke and define them, scope, and parameters.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found