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

Feature: Add line/links to error messages #7045

Open
orta opened this issue May 13, 2019 · 2 comments
Open

Feature: Add line/links to error messages #7045

orta opened this issue May 13, 2019 · 2 comments

Comments

@orta
Copy link
Contributor

orta commented May 13, 2019

Is this a bug report?

No

How it is now

I have an error message like this:

Compiled with warnings.

./src/components/installation/Websocket.tsx
  Line 77:  Expected to return a value at the end of arrow function  array-callback-return

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

I can cmd+click on ./src/components/installation/Websocket.tsx and it'll take me to the right file ⭐️

What would be nice is that in the case where there is one error per file, it could instead be ./src/components/installation/Websocket.tsx:77 and clicking on that in the terminal would take directly there. The :77 could be colored using ANSI to be the background color, so it's not visible.

Alternatively, and perhaps a nicer UI, is to use hyperlinks one the Line 77 using something like hyperlinker which would have the href as ./src/components/installation/Websocket.tsx:77. This works in quite a lot of terminals now.

Screen Shot 2019-05-13 at 1 06 22 PM

@heyimalex
Copy link
Contributor

Related to #6980 I think, though the hyperlinker suggestion is new.

@justingrant
Copy link
Contributor

If we do this, please make sure to include the column number too, not just the line number, so that editors can navigate to the exact row/col position. I believe the usual format is something like
/foo/bar.js:287:13 which will navigate to line 287, column 13 of bar.js.

See https://www.gnu.org/prep/standards/html_node/Errors.html

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