Skip to content

Add a link to error output #439

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

Closed
octref opened this issue Mar 22, 2018 · 9 comments
Closed

Add a link to error output #439

octref opened this issue Mar 22, 2018 · 9 comments

Comments

@octref
Copy link
Member

octref commented Mar 22, 2018

See vuejs/vetur#738 and vuejs/vetur#261

Many new Vue users are having a hard time figuring out the meaning of the error message for v-bind:key.

I think it would be nice if eslint-plugin-vue offers a url for each rule, this way I can render the URL and people can find more information about each error there.

eslint

@octref
Copy link
Member Author

octref commented Mar 22, 2018

Also, I suggest adding links to either official doc or style guide in each rule's markdown file. For example, for this one: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/valid-v-bind.md

I think both https://vuejs.org/v2/guide/list.html#key and https://vuejs.org/v2/style-guide/#Keyed-v-for-essential should be linked in a section like Related Links.

@octref
Copy link
Member Author

octref commented Mar 22, 2018

/cc @chrisvfritz as you might be interested.`

@michalsnik
Copy link
Member

Good idea @octref with putting links in documentation :)

But when it comes to displaying rules' URLs in vuetur's tooltips, you can already take advantage of eslint-rule-documentation. Check it out here. Usage is as simple as:

const getRuleURI = require('eslint-rule-documentation');

getRuleURI('vue/require-v-for-key');

@chrisvfritz
Copy link
Contributor

Cool idea! Any chance of the links being openable, like via a shortcut?

@octref
Copy link
Member Author

octref commented Mar 22, 2018

eslint-rule-documentation

Very nice. Thanks for the tip.

Cool idea! Any chance of the links being openable, like via a shortcut?

image

This is using Hover since it allows markdown (and therefore linkified links).
When microsoft/language-server-protocol#250 is addressed I can use the markdown for the error message too.

@michalsnik
Copy link
Member

michalsnik commented Mar 24, 2018

Cool :) So if the rest is on your side now, let me set the definition of done for us, regarding your suggestion:

  • Update rules documentations with links to style guide

@michalsnik
Copy link
Member

@octref I added links to more details in all relevant rules :)

@octref
Copy link
Member Author

octref commented Aug 1, 2018

Will upgrade the deps and get it soon. vuejs/vetur#849
Thanks for your work!

@octref
Copy link
Member Author

octref commented Jan 2, 2019

Unfortunately this still depends on upstream changes in: microsoft/vscode#54272

Otherwise, I cannot render the link in diagnostic hover (the one you saw was on normal hover).

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

3 participants