Closed
Description
Bug Report
π Search Terms
json import assertions ambient types
β― Playground Link
n/a
π» Code
locationData.json.d.ts
export interface Location {
id: string
}
declare const locations: Location[]
export default locations
locationData.json
[
{
"id": "loc-1"
}
]
index.ts
import locations from './locationsData.json' assert { type: 'json' }
import type { Location } from './locationsData.json'
tsconfig.json
{
"compilerOptions": {
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "NodeNext",
"outDir": "dist",
"strict": true,
"target": "ESNext",
},
}
π Actual behavior
locations
is untyped (any)
π Expected behavior
locations
should be typed
it works as expected with "moduleResolution": "Node"