Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links to rule explanations? #15

Closed
wmertens opened this issue Jul 18, 2016 · 4 comments
Closed

Add links to rule explanations? #15

wmertens opened this issue Jul 18, 2016 · 4 comments

Comments

@wmertens
Copy link

Not sure if this is possible, but it would be nice to be able to go to a rule definition (like the github issue or eslint docs) when eslint marks something.

So if I see no-use-extend-native it somehow links to https://github.com/dustinspecker/eslint-plugin-no-use-extend-native/blob/master/readme.md

@SamVerschueren
Copy link
Collaborator

That would really be a very nice addition. It can be opened when using Cmd + click or something.

I guess it would be easier to implement if we redirect to the npm webpage. For instance to https://www.npmjs.com/package/eslint-plugin-no-use-extend-native. This way we don't have to fetch the repository of that rule. We can start with implementing this and if it looks like it's not enough, we can always improve on that by caching ruleId + GH repo. What do you think?

I'm not entirely sure if this can be implemented in an extension though.

@bpasero Care to chime in?

@darkred
Copy link

darkred commented Aug 30, 2021

The ability to add links to diagnostic errors has been added to VSCode since v1.42 (Jan 2020) : see here.

E.g. here is a screenshot of how the related rules of the problems are rendered by this extension vs the ESLint one:
2021-08-30_180348

@spence-s
Copy link
Collaborator

I currently have this as a WIP - along with other features mentioned in the roadmap. This particular feature needs a patch in xo and also needs some good internal caching strategies to ensure performance. So its just a matter of finding the time. PRs welcome!

@spence-s spence-s self-assigned this Aug 30, 2021
@spence-s
Copy link
Collaborator

After doing some further research on this - I found that xo primarily relies on the package https://www.npmjs.com/package/eslint-rule-docs which I am using to add rule definition links as well. No need to add this directly to xo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants