-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: Version 3.8.3
Search Terms: json rootDir
Code
Folder structure:
src/test.ts
src/tsconfig.json
data/dummy.json
tsconfig:
{
"compilerOptions": {
"esModuleInterop": true,
"resolveJsonModule": true,
"rootDirs": [
".",
"../data"
]
}
}test.ts:
import dummy from "./dummy.json"
console.log(dummy)Expected behavior:
JSON printed to stdout.
Actual behavior:
The error: src/test.ts:1:19 - error TS6059: File 'repro/data/dummy.json' is not under 'rootDir' 'repro/src'. 'rootDir' is expected to contain all source files.
Playground Link:
Related Issues:
klesun and kaznovac
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug