You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tsc does not error mixing type and actual variable in same import statement on importsNotUsedAsValues=error #36959
tsc with importsNotUsedAsValues=error does not error that mixing type and actual variables in same import statement (e.g. import { TypeName, ActualVariable } from '.....';)
In main.ts, tsc does not cause error about using import type {} from ....
If we change main.ts to the following, tsc make it error correctly.
// main.tsimport{Bar}from'./bar';// By tsc: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.ts(1371)`import{getBar}from'./bar';consta: Bar=getBar();console.log(a);
Playground Link:
I'm sorry. I could not find a way to create this snippet in TypeScript PlayGround.
This is the intended behavior. The intent of the flag is to tell you about import declarations that would "go missing" during type-only elision (thus potentially changing runtime behavior), not to tell you about clauses that would be removed (which have no effect).
Activity
RyanCavanaugh commentedon Feb 26, 2020
This is the intended behavior. The intent of the flag is to tell you about import declarations that would "go missing" during type-only elision (thus potentially changing runtime behavior), not to tell you about clauses that would be removed (which have no effect).
typescript-bot commentedon Feb 29, 2020
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.