Closed
Description
π Search Terms
include composite resolveJsonModule
Reopening of #25636 which doesn't seem to have fixed all problems reported in that issue
π Version & Regression Information
This is the behavior in every version I tried (up until 4.1)
β― Playground Link
https://github.com/eps1lon/ts-references-json
π» Code
import data from "./data.json";
export default { data };
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"composite": true
},
"include": ["./**/*"]
}
π Actual behavior
$ tsc --build tsconfig.json
feature-two/index.ts:1:18 - error TS6307: File '/Users/sebastian.silbermann/ts-references-json/feature-two/data.json' is not listed within the file list of project '/Users/sebastian.silbermann/ts-references-json/feature-two/tsconfig.json'. Projects must list all files or use an 'include' pattern.
1 import data from "./data.json";
~~~~~~~~~~~~~
Found 1 error.
Explicitly adding .json
to include
like #25636 (comment) suggested works also but is unintuitive since the extension is only required in composite projects.
π Expected behavior
Compiles just fine without having to add another include
pattern using .json
.