( workPath: string )
| 145 | } |
| 146 | |
| 147 | export const findNearestTsconfig = async ( |
| 148 | workPath: string |
| 149 | ): Promise<string | undefined> => { |
| 150 | const tsconfigPath = join(workPath, 'tsconfig.json'); |
| 151 | if (existsSync(tsconfigPath)) { |
| 152 | return tsconfigPath; |
| 153 | } |
| 154 | if (workPath === '/') { |
| 155 | return undefined; |
| 156 | } |
| 157 | return findNearestTsconfig(join(workPath, '..')); |
| 158 | }; |