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.

Proposal: Tiny URLs for rules in stylish formatter

See original GitHub issue

Hi there. A common problem for me is, that sometimes I violate a rule, that I’ve never heard before. Typically I see this:

screen shot 2017-07-30 at 13 15 46

Now I fire up <search engine> and enter eslint no-undef or eslint react/jsx-no-bind to find out what this rule is about. This process could be easier, if there was a link to the documentation of the linting rule, like this:

screen shot 2017-07-30 at 13 31 06

or this

screen shot 2017-07-30 at 13 33 19

While adjusting the formatter, I found that some documentation links would be really long, like https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md, which obviously look bad, so this is why I used a shorter version http://example.org/r/{ruleId}.

Yesterday I had a look into creating a simple redirect service with the help of nginx, it is pretty easy, e.g.

location /r/react/ {
    rewrite ^/r/react/([a-z-]*)$ https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules/$1.md permanent;
    return 404;
}

Now before I start implementing things, I wanted to ask the maintainers and community if they think this feature is useful and if they’d like me to implement it.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Krinklecommented, Aug 12, 2017

@leipert Another way would be to introduce a url property into the rule registry, could be placed alongside the existing meta data that rules have (docs, fixable, category, etc.).

It seems to me like this would provide a more scalable approach, would relying on a centralised service or other indirection layers. The formatter will have access to this meta data and can choose to output it in some form.

0reactions
not-an-aardvarkcommented, Sep 16, 2017

Thanks for your interest in improving ESLint. Unfortunately, it looks like this issue didn’t get consensus from the team, so I’m closing it. We define consensus as having three 👍s from team members, as well as a team member willing to champion the proposal. This is a high bar by design – we can’t realistically accept and maintain every feature request in the long term, so we only accept feature requests which are useful enough that there is consensus among the team that they’re worth adding.

Since ESLint is pluggable and can load custom formatters at runtime, the lack of consensus among the ESLint team doesn’t need to be a blocker for you using this in your project, if you’d find it useful. It just means that you would need to implement the formatter yourself, rather than using a bundled formatter that is packaged with ESLint.

Read more comments on GitHub >

github_iconTop Results From Across the Web

URLs: Some Practical Advice | MLA Style Center
In this post, I offer commonsense guidelines on treating URLs in works-cited-list entries. First, it is important to keep in mind that ...
Read more >
Shortened URLs in APA Style references
The guidance in Section 9.36 about shortened URLs is (a) optional and (b) applicable only to references that include a long or complex...
Read more >
How to Format URLs in Text - Quick and Dirty Tips ™
All the rules for how to handle uniform resource locators (or URLs) in documents are matters of style, but some styles make more...
Read more >
Format Attachments - NIH Office of Extramural Research
We have very specific attachment formatting requirements. ... Most style guides include format guidance for citations and all formats are ...
Read more >
Preparing and Formatting Your Proposal Document - SIOP
Preparing & Formatting Your Proposal ... Submissions that do not follow the rules for submission, including word count, ... Links to Social Media...
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