Skip to content

Commit

Permalink
fix(message): not display error message when target file is not .ts o…
Browse files Browse the repository at this point in the history
…r .tsx file
  • Loading branch information
d-kimsuon committed Sep 4, 2021
1 parent 4226bed commit 9c74fdb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/compilerHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ export class CompilerHandler {

const sourceFile = this.program.getSourceFile(filePath)
if (!sourceFile) {
throw new Error(`File not found: ${filePath}`)
if (filePath.endsWith(".ts") || filePath.endsWith(".tsx")) {
throw new Error(`File not found: ${filePath}`)
} else {
return undefined
}
}
let pos: number
try {
Expand Down

0 comments on commit 9c74fdb

Please sign in to comment.