Skip to content

Commit

Permalink
Parameter to leave includes as in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
kasthor committed Aug 29, 2023
1 parent c01619f commit 5cbb479
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const argsProjectIndex = args.findIndex(arg =>
const argsProjectValue =
argsProjectIndex !== -1 ? args[argsProjectIndex + 1] : undefined

const argsLeaveIncludesUntouched =
args.findIndex(arg => ['-i'].includes(arg)) !== -1

const files = args.filter(file => /\.(ts|tsx)$/.test(file))
if (files.length === 0) {
process.exit(0)
Expand Down Expand Up @@ -53,7 +56,7 @@ const tmpTsconfig = {
skipLibCheck: true,
},
files,
include: [],
...(argsLeaveIncludesUntouched ? {} : { includes: [] }),
}
fs.writeFileSync(tmpTsconfigPath, JSON.stringify(tmpTsconfig, null, 2))

Expand Down

0 comments on commit 5cbb479

Please sign in to comment.