TypeScript Version: 3.6.3, actually most likely all versions since v3.2
Search Terms: composite, resolveJSONModule, tsserver, TS6307, include pattern
Code
Not particularly easy to show with code, but here's a repro:
https://github.com/lierdakil/ts6307-composite-json-tsserver-test
npm installnode test.js in a terminaltest.js (ctrl+C or whathaveyou)Note: test.js just spawns tsserver and tells it to open src/test.ts.
Please see README for a complete listing.
Expected behavior:
No error diagnostics.
Actual behavior:
In tsserver output, we see:
{"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"src/test.ts","configFile":"tsconfig.json","diagnostics":[{"text":"File '/tmp/test/src/blabla.json' is not listed within the file list of project 'tsconfig.json'. Projects must list all files or use an 'include' pattern.","code":6307,"category":"error"}]}}
That is, TS6307 on a JSON file, which is included in the project via include pattern.
Additional observations:
composite: true.tsserver, but not in tsc itself.tsconfig.json uses include, but not when it uses files.Related Issues:
Other related issues (from external projects):
https://github.com/TypeStrong/ts-loader/issues/905
https://github.com/TypeStrong/atom-typescript/issues/1512
Looks like https://github.com/microsoft/TypeScript/blob/master/src/services/services.ts#L956 is causing this
Is this fix live on npm yet?
Most helpful comment
Is this fix live on npm yet?