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

fix: use :line:col format in webpack errors #489

Merged
merged 3 commits into from
Jul 28, 2020

Conversation

robcrocombe
Copy link
Contributor

Fixes #481

As discussed in #481, changes the format of TypeScript error file locations to use file:line:col. This means files can be opened from the terminal at the location the error occurred (e.g. cmd+click on Mac). Like this:

ERROR in /Users/.../customer.ts:86:16
TS2551: Property 'giveName' does not exist on type 'Customer'. Did you mean 'givenName'?
    84 |     }
    85 |     if (c.givenName) {
  > 86 |       return c.giveName;
       |                ^^^^^^^^
    87 |     }
    88 |     if (c.familyName) {
    89 |       return c.familyName;

The location end is still used in the code frame.

@robcrocombe
Copy link
Contributor Author

The E2E tests are broken, I will take a look when I can.

@johnnyreilly
Copy link
Member

Hey @robcrocombe

I just noticed you're a fellow Londoner. Hello fellow Londoner! Whereabouts do you work when you're in the office? I'm pretty central; though like everyone else I've been homebased since March.

@robcrocombe
Copy link
Contributor Author

Hey @johnnyreilly yep, I'm based in Old Street :) Except for now I'm also working from home.

I've updated the tests to handle both formats, since I don't think the async: false option is being changed.

@johnnyreilly
Copy link
Member

Hey @johnnyreilly yep, I'm based in Old Street :) Except for now I'm also working from home.

Haha nice! I'm near St Paul's Cathedral.... Daring to consider cycling into town sometime. Just to have my own personal 28 days later experience 😉

Copy link
Member

@johnnyreilly johnnyreilly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my one question; looking good otherwise!

test/e2e/WebpackProductionBuild.spec.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@piotr-oles piotr-oles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! I hope we can make it consistent across async and sync mode ;)

test/e2e/EsLint.spec.ts Outdated Show resolved Hide resolved
@codeclimate
Copy link

codeclimate bot commented Jul 27, 2020

Code Climate has analyzed commit 67200af and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Collaborator

@piotr-oles piotr-oles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍

@robcrocombe
Copy link
Contributor Author

robcrocombe commented Jul 28, 2020

Thanks @piotr-oles! Some E2E tests are timing out, doesn't seem related to my change. Can we re-run them without pushing a new commit?

@johnnyreilly
Copy link
Member

I think I've requeued the tests....

@piotr-oles piotr-oles merged commit f3a0c98 into TypeStrong:master Jul 28, 2020
@robcrocombe
Copy link
Contributor Author

Thanks guys, looking forward to using it :)

@piotr-oles
Copy link
Collaborator

🎉 This PR is included in version 5.0.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

robcrocombe added a commit to unravelin/fork-ts-checker-webpack-plugin that referenced this pull request Mar 1, 2022
Reimplements TypeStrong#489 so that file links with locations can be clicked in
the terminal.
robcrocombe added a commit to unravelin/fork-ts-checker-webpack-plugin that referenced this pull request Mar 1, 2022
Reimplements TypeStrong#489 so that file links with locations can be clicked in
the terminal.
robcrocombe added a commit to unravelin/fork-ts-checker-webpack-plugin that referenced this pull request Mar 1, 2022
Reimplements TypeStrong#489 so that file links with locations can be clicked in
the terminal.
robcrocombe added a commit to unravelin/fork-ts-checker-webpack-plugin that referenced this pull request May 1, 2022
Reimplements TypeStrong#489 so that file links with locations can be clicked in
the terminal.
piotr-oles pushed a commit that referenced this pull request May 1, 2022
Reimplements #489 so that file links with locations can be clicked in the terminal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TS error in file can no longer be opened at the error location (v4 -> v5)
3 participants