π Search Terms
"import type", "resolveJsonModule", "import json"
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about
import type
β― Playground Link
can't provide playground link due to #63658
π» Code
import type T from "./translations.json";
export function getTranslations() {
return {} as T;
}
π Actual behavior
Error on line 4:
'T' refers to a value, but is being used as a type here. Did you mean 'typeof T'? [2749]
π Expected behavior
T should be treated as a type since it was imported with import type
Additional information about the issue
To reproduce this issue you must set "resolveJsonModule": true in tsconfig.json
π Search Terms
"import type", "resolveJsonModule", "import json"
π Version & Regression Information
import typeβ― Playground Link
can't provide playground link due to #63658
π» Code
π Actual behavior
Error on line 4:
π Expected behavior
Tshould be treated as a type since it was imported withimport typeAdditional information about the issue
To reproduce this issue you must set
"resolveJsonModule": trueintsconfig.json