Skip to content

Commit 5cbb479

Browse files
committed
Parameter to leave includes as in config file
1 parent c01619f commit 5cbb479

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ const argsProjectIndex = args.findIndex(arg =>
2626
const argsProjectValue =
2727
argsProjectIndex !== -1 ? args[argsProjectIndex + 1] : undefined
2828

29+
const argsLeaveIncludesUntouched =
30+
args.findIndex(arg => ['-i'].includes(arg)) !== -1
31+
2932
const files = args.filter(file => /\.(ts|tsx)$/.test(file))
3033
if (files.length === 0) {
3134
process.exit(0)
@@ -53,7 +56,7 @@ const tmpTsconfig = {
5356
skipLibCheck: true,
5457
},
5558
files,
56-
include: [],
59+
...(argsLeaveIncludesUntouched ? {} : { includes: [] }),
5760
}
5861
fs.writeFileSync(tmpTsconfigPath, JSON.stringify(tmpTsconfig, null, 2))
5962

0 commit comments

Comments
 (0)