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

Working as expected on first line diagnostic.start #190

Merged
merged 2 commits into from
Dec 13, 2018

Conversation

radiosterne
Copy link
Contributor

If Typescript diagnostic starts on line 0, fork-ts-checker-webpack-plugin as of 0.5.1 fails and throws an error, which it shouldn't. This humble and small PR fixes it :) I'll update package.json and changelog.md if needed.

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.

Thanks for contributing! Could you get the tests to pass please?

@@ -51,7 +51,7 @@ export class NormalizedMessage {
let character: number | undefined;
if (diagnostic.file) {
file = diagnostic.file.fileName;
if (!diagnostic.start) {
if (typeof diagnostic.start === 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

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

Could this be diagnostic.start === undefined instead please? Marginally more performant and my personal preference.

@johnnyreilly
Copy link
Member

Oh and yes updating package.json and CHANGELOG.md appreciated!

package.json and CHANGELOG.md bump
@radiosterne
Copy link
Contributor Author

@johnnyreilly looks like the tests were not passing in master as well due to fs.existsSync changes in node v10. Given that existsSync is deprecated, I took the liberty of creating a helper to emulate it :)

@johnnyreilly
Copy link
Member

Thanks!

@johnnyreilly johnnyreilly merged commit fe2a35d into TypeStrong:master Dec 13, 2018
@johnnyreilly
Copy link
Member

Should be released in 30 mins or so - thanks for the contribution! 🌻♥️

@@ -46,7 +48,7 @@ export class CancellationToken {
if (duration > 10) {
// check no more than once every 10ms
this.lastCancellationCheckTime = time;
this.isCancelled = fs.existsSync(this.getCancellationFilePath());
this.isCancelled = FsHelper.existsSync(this.getCancellationFilePath());
Copy link
Contributor

Choose a reason for hiding this comment

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

existsSync is NOT deprecated!
See https://nodejs.org/api/fs.html#fs_fs_existssync_path

Copy link
Member

Choose a reason for hiding this comment

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

Oh that's correct! Would you care to submit a PR reverting that change?

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

Successfully merging this pull request may close these issues.

3 participants