Skip to content

Commit

Permalink
fix tsconfig bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-murakami committed Sep 1, 2023
1 parent 4d9f791 commit 18f93bf
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions bin/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,7 @@ function InsertRootdirFilesPath2TSconfig() {
if (tsconfigContents) {
const tsconfig = JSON.parse(tsconfigContents)
// add "include" project root's configs avoid '@typescript-eslint/await-thenable's parse error https://elmah.io/tools/stack-trace-formatter/212c0a4849bc4054826e4055f5d167a7/
const injectPathList = ['./**.js', './**.ts', './**.cjs', './**.mjs']
if (Array.isArray(tsconfig.include)) {
injectPathList.forEach((injectPath) => {
if (false === tsconfig.include.includes(injectPath)) {
tsconfig.include.push(injectPath)
}
})
} else {
// `tsconfig.json` dosn't have "include" fileld
tsconfig.include = injectPathList
}
tsconfig.include = ['./**.js', './**.ts', './**.cjs', './**.mjs', ...tsconfig.include]
writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2))
} else {
console.log('tsconfig.json not found in root directory')
Expand Down

0 comments on commit 18f93bf

Please sign in to comment.