-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Description
TypeScript Version: 2.1.4
Code
$ mkdir ts-error
$ cd ts-error
$ npm install typescript@2.1.4
$ echo '{"files": []}' > tsconfig.json
$ ./node_modules/.bin/tsc
error TS18002: The 'files' list in config file '/Users/danfuzz/testing/ts/tsconfig.json' is empty.Expected behavior:
tsc doesn't complain about not actually getting asked to compile anything.
Actual behavior:
The error as noted.
Context:
It is of course pretty silly to actually use the TS compiler on the commandline and with an actual tsconfig.json in the way demo'ed here. However, in the case of using the ts-loader module to hook up the TS compiler to Webpack, this is how it sets itself up. (I'm just a user of ts-loader, not a developer of it, so please take this with a grain of salt.) AIUI ts-loader sets up the basic config with an empty files, and then makes separate calls to compile each file it's asked to, one at a time. This arrangement worked as of typescript version 2.0.10, but it broke as of 2.1.4.
I also filed TypeStrong/ts-loader#405 on ts-loader. It's not clear to me what the best way to address the issue is.