Skip to content

Editing ".js" file does not update errors in ".ts" file #15826

@ghost

Description

TypeScript Version: nightly (2.4.0-dev.20170513)

Code

(with --allowJs)

a.js

export const x = 0;

b.ts

import * as a from "./a";
a.x;
a.y;

See the error in b.ts on a.y. Then add export const y = 1; to a.js.

Expected behavior:

No more error in b.ts.

Actual behavior:

Still see the error.

Note: I tried writing a fourslash test but couldn't produce the error that way. May be a problem in vscode.

/// <reference path="fourslash.ts" />

// @allowJs: true

// @Filename: /a.js
////export const x = 0;
/////*insert*/

// @Filename: /b.ts
/// <reference path="fourslash.ts" />
////import * as a from "./a";
////a.x;
////a.y;

goTo.file("/b.ts");
verify.numberOfErrorsInCurrentFile(1);

goTo.marker("insert");
edit.insertLine("export const y = 1;");

goTo.file("/b.ts");
verify.numberOfErrorsInCurrentFile(0);

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueNeeds More InfoThe issue still hasn't been fully clarified

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions