tsc does not error mixing type and actual variable in same import statement on importsNotUsedAsValues=error #36959
Labels
Working as Intended
The behavior described is the intended behavior; this is not a bug
TypeScript Version: 3.8.2
Search Terms:
tsc with
importsNotUsedAsValues=error
does not error that mixing type and actual variables in same import statement (e.g.import { TypeName, ActualVariable } from '.....';
)Code
Set options is
importsNotUsedAsValues=error
Expected behavior:
import { Bar, getBar } from './bar';
should be error becauseBar
is used only as type. tsc should suggest to split into 2 line like:Actual behavior:
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.
Playground Link:
I'm sorry. I could not find a way to create this snippet in TypeScript PlayGround.
Related Issues:
The text was updated successfully, but these errors were encountered: