gustavopch / tsc-files

A tiny tool to run `tsc` on specific files without ignoring tsconfig.json
MIT License
234 stars 49 forks source link

Allow -i or --include argument for custom include files #38

Open jmmendivil opened 2 years ago

jmmendivil commented 2 years ago

Solution for #20

Use with a single file or glob: tsc-files -i ./dir/**/*.ts Use with a list of files, separated by coma: tsc-files -i A.ts,B.ts

gustavopch commented 2 years ago

Thanks for the PR, @jmmendivil, but I think it's ambiguous to let specify files both through positional (tsc-files foo.ts) and named arguments (tsc-files -i foo.ts). I think a better API would be to just identify glob patterns in the positional arguments and add them to include, so it would be used like this: tsc-files foo.ts bar/**/*.ts.

jmmendivil commented 2 years ago

Hey, thanks for review the PR @gustavopch The include option for the config file lets you add an array of filenames or patterns, if we restrict it to glob only, it wouldn't be exactly as the include from the config file. I could be wrong, but I thought the idea for the lib is to be as transparent as possible for the tsc config and cli args

You can use files and include arguments just fine: tsc-files -i foo.ts bar.ts

erickbelfy commented 2 years ago

is there any conclusion to this? i kinda of need that PR to be merged cuz I'm facing the same scenario

gustavopch commented 2 years ago

@erickbelfy I'm not having time to review/test because I'm super busy with work, so what I'm suggesting is that people copy the source code — which is actually quite small — and modify as needed, or fork, or use https://npm.im/patch-package to apply the changes locally. Sorry.