Typescript: False-Positive noUnusedLocals-checks in watch-mode

Created on 7 Feb 2018  路  5Comments  路  Source: microsoft/TypeScript

I found some related issues. But I am pretty sure all of them are related to normal mode and not watch-mode. My bug occours only in watch-mode.

TypeScript Version: 2.7.1

Search Terms:
noUnusedLocals, is declared but its value is never read, Write-only references now flagged as unused

Code
Checkout the repo https://github.com/thomaskempel/tsc2.7.1-bug and run tsc --noEmit -w -p .

Expected behavior:
It runs without errors. Because all impors are acutally called or read.

Actual behavior:
Shows error

08:47:04 - Starting compilation in watch mode...
src/fileWithError.ts(2,3): error TS6133: 'IActionType' is declared but its value is never read.
08:47:06 - Compilation complete. Watching for file changes.

Playground Link:
https://github.com/thomaskempel/tsc2.7.1-bug

Related Issues:
This could be related. But my error only shows up in watch-mode
https://github.com/Microsoft/TypeScript/issues/19700

Most helpful comment

Duplicate of https://github.com/Microsoft/TypeScript/issues/21478. Fix should be available today in typescript@next and in the upcoming [email protected] in a week or so.

All 5 comments

I ran into another problem with watch mode: https://github.com/marianmeres/typescript-2.7.1-issue which I think might be related to your report (not sure). I was about to submit it as a bug, but found out that it is no issue in 'next' version...

Anyway, your report is closest to what I could find relevant, so I'm just posting it here for reference.

thank you. In fact the bug is fixed in the next version.

I had the same issue. I downgrade typescript to 2.6.2 as you say in your repo. Just to report that it was a real issue to other people.

Duplicate of https://github.com/Microsoft/TypeScript/issues/21478. Fix should be available today in typescript@next and in the upcoming [email protected] in a week or so.

sweet. I can confirm that it's fixed in next. Thanks for the info.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Roam-Cooper picture Roam-Cooper  路  3Comments

kyasbal-1994 picture kyasbal-1994  路  3Comments

dlaberge picture dlaberge  路  3Comments

wmaurer picture wmaurer  路  3Comments

manekinekko picture manekinekko  路  3Comments